From 8578a4fbc184b0b05918179090d931034c7659fe Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 20 Mar 2024 08:23:27 +0200 Subject: [PATCH] Revert "Minify files on production (#429)" We'll revisit later --- package.json | 2 +- src/layouts/partials/scripts.html | 17 +++++------------ src/layouts/partials/stylesheet.html | 6 +----- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 54c43b3f3..d5b2b707d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "scripts": { "start": "npm run serve", - "build": "hugo --cleanDestinationDir --minify --printPathWarnings --printUnusedTemplates", + "build": "hugo --cleanDestinationDir --printPathWarnings --printUnusedTemplates", "serve": "hugo server --port 4000 --disableFastRender --noHTTPCache --renderToMemory --printPathWarnings --printUnusedTemplates", "serve-only": "npx sirv-cli _site --port 4000", "test": "npm-run-all build --parallel --continue-on-error --aggregate-output test-*", diff --git a/src/layouts/partials/scripts.html b/src/layouts/partials/scripts.html index bfc65d0c2..42722076d 100644 --- a/src/layouts/partials/scripts.html +++ b/src/layouts/partials/scripts.html @@ -7,19 +7,12 @@ {{- $bootstrapJs := resources.Get "/js/vendor/bootstrap.bundle.min.js" | fingerprint | resources.Copy "/assets/js/vendor/bootstrap.bundle.min.js" -}} -{{- $scripts := slice "js/application.js" "js/lazyload.js" -}} -{{- range $scriptFile := $scripts -}} - {{- $script := resources.Get $scriptFile | js.Build $esbuildOptions -}} +{{- $application := resources.Get "js/application.js" | js.Build $esbuildOptions | fingerprint | resources.Copy "/assets/js/application.js" -}} +{{- $lazyload := resources.Get "js/lazyload.js" | js.Build $esbuildOptions | fingerprint | resources.Copy "/assets/js/lazyload.js" -}} - {{- if hugo.IsProduction -}} - {{- $script = $script | resources.Minify -}} - {{- end -}} - - {{- $script = $script | fingerprint | resources.Copy (path.Join "/assets" $scriptFile) -}} - - -{{- end -}} + + {{ range .Page.Params.extra_js -}} - + {{- end -}} diff --git a/src/layouts/partials/stylesheet.html b/src/layouts/partials/stylesheet.html index 1f8ff3720..e70056e44 100644 --- a/src/layouts/partials/stylesheet.html +++ b/src/layouts/partials/stylesheet.html @@ -5,10 +5,6 @@ {{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}} {{- end -}} -{{- $style := resources.Get "scss/style.scss" | toCSS $sassOptions | postCSS $postcssOptions -}} -{{- if hugo.IsProduction -}} - {{- $style = $style | resources.Minify -}} -{{- end -}} -{{- $style = $style | fingerprint -}} +{{- $style := resources.Get "scss/style.scss" | toCSS $sassOptions | postCSS $postcssOptions | fingerprint -}}