Skip to content

Commit 95ab1a1

Browse files
committed
chore(js): Remove unnecessary JS module config, remove redundant index.js
1 parent d3f7ab3 commit 95ab1a1

File tree

6 files changed

+17753
-16
lines changed

6 files changed

+17753
-16
lines changed

assets/js/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/js/theme-switch.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
import Theme from './theme.js';
22

33
export default function ThemeSwitch({ component }) {
4-
if ( component == undefined) {
4+
if (component === undefined) {
55
component = document;
66
}
7-
component.querySelectorAll(`.theme-switch-light`).forEach((button) => {
8-
button.addEventListener('click', function(event) {
7+
8+
component.querySelectorAll('.theme-switch-light').forEach((button) => {
9+
button.addEventListener('click', function (event) {
910
event.preventDefault();
10-
Theme({component, style: 'light-theme' });
11+
Theme({ component, style: 'light-theme' });
1112
});
1213
});
1314

14-
component.querySelectorAll(`.theme-switch-dark`).forEach((button) => {
15-
button.addEventListener('click', function(event) {
15+
component.querySelectorAll('.theme-switch-dark').forEach((button) => {
16+
button.addEventListener('click', function (event) {
1617
event.preventDefault();
17-
Theme({component, style: 'dark-theme' });
18+
Theme({ component, style: 'dark-theme' });
1819
});
1920
});
2021
}

hugo.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,25 @@ outputFormats:
5656
isPlainText: true
5757

5858
build:
59-
# Ensure Hugo correctly processes JavaScript modules
60-
jsConfig:
61-
nodeEnv: "development"
59+
# Configure JavaScript build settings for ES6 modules
60+
writeStats: true
61+
useResourceCacheWhen: "fallback"
62+
63+
# Asset processing configuration
64+
assetDir: "assets"
6265

6366
module:
6467
mounts:
6568
- source: assets
6669
target: assets
67-
6870
- source: node_modules
69-
target: assets/node_modules
71+
target: assets/node_modules
72+
73+
# Ensure proper JavaScript processing in development
74+
minify:
75+
disableJS: true
76+
minifyOutput: false
77+
78+
# Development settings
79+
params:
80+
env: development

0 commit comments

Comments
 (0)