chore(js): Remove unnecessary JS module config, remove redundant index.js
parent
483b41753a
commit
c43df7508f
|
@ -1 +0,0 @@
|
|||
export * from './main.js';
|
|
@ -1,17 +1,18 @@
|
|||
import Theme from './theme.js';
|
||||
|
||||
export default function ThemeSwitch({ component }) {
|
||||
if ( component == undefined) {
|
||||
if (component === undefined) {
|
||||
component = document;
|
||||
}
|
||||
component.querySelectorAll(`.theme-switch-light`).forEach((button) => {
|
||||
|
||||
component.querySelectorAll('.theme-switch-light').forEach((button) => {
|
||||
button.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
Theme({ component, style: 'light-theme' });
|
||||
});
|
||||
});
|
||||
|
||||
component.querySelectorAll(`.theme-switch-dark`).forEach((button) => {
|
||||
component.querySelectorAll('.theme-switch-dark').forEach((button) => {
|
||||
button.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
Theme({ component, style: 'dark-theme' });
|
||||
|
|
19
hugo.yml
19
hugo.yml
|
@ -56,14 +56,25 @@ outputFormats:
|
|||
isPlainText: true
|
||||
|
||||
build:
|
||||
# Ensure Hugo correctly processes JavaScript modules
|
||||
jsConfig:
|
||||
nodeEnv: "development"
|
||||
# Configure JavaScript build settings for ES6 modules
|
||||
writeStats: true
|
||||
useResourceCacheWhen: "fallback"
|
||||
|
||||
# Asset processing configuration
|
||||
assetDir: "assets"
|
||||
|
||||
module:
|
||||
mounts:
|
||||
- source: assets
|
||||
target: assets
|
||||
|
||||
- source: node_modules
|
||||
target: assets/node_modules
|
||||
|
||||
# Ensure proper JavaScript processing in development
|
||||
minify:
|
||||
disableJS: true
|
||||
minifyOutput: false
|
||||
|
||||
# Development settings
|
||||
params:
|
||||
env: development
|
File diff suppressed because it is too large
Load Diff
|
@ -13,7 +13,7 @@
|
|||
{{ $products := .Site.Data.products }}
|
||||
{{ $influxdb_urls := .Site.Data.influxdb_urls }}
|
||||
<!-- Build index.js -->
|
||||
{{ with resources.Get "js/index.js" }}
|
||||
{{ with resources.Get "js/main.js" }}
|
||||
{{ $opts := dict
|
||||
"minify" hugo.IsProduction
|
||||
"sourceMap" (cond hugo.IsProduction "" "external")
|
||||
|
|
|
@ -66,8 +66,6 @@
|
|||
"test:links:api-docs": "node cypress/support/run-e2e-specs.js --spec \"cypress/e2e/content/article-links.cy.js\" /influxdb3/core/api/,/influxdb3/enterprise/api/,/influxdb3/cloud-dedicated/api/,/influxdb3/cloud-dedicated/api/v1/,/influxdb/cloud-dedicated/api/v1/,/influxdb/cloud-dedicated/api/management/,/influxdb3/cloud-dedicated/api/management/",
|
||||
"test:shortcode-examples": "node cypress/support/run-e2e-specs.js --spec \"cypress/e2e/content/article-links.cy.js\" content/example.md"
|
||||
},
|
||||
"main": "assets/js/main.js",
|
||||
"module": "assets/js/main.js",
|
||||
"type": "module",
|
||||
"browserslist": [
|
||||
"last 2 versions",
|
||||
|
|
Loading…
Reference in New Issue