Эх сурвалжийг харах

refactor: build JS as ESM

Remove Bootstrap sourcemap ref as Hugo doesn't detect/publish it.
George Cushen 4 жил өмнө
parent
commit
d70e23ef55

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
wowchemy/assets/js/_vendor/bootstrap.bundle.min.js


+ 3 - 1
wowchemy/layouts/_default/baseof.html

@@ -22,7 +22,9 @@
   {{- end -}}
   {{ $js_bundle := slice $js_bundle_head $js_bundle | resources.Concat "js/wowchemy-init.min.js" }}
   {{- if hugo.IsProduction -}}
-    {{- $js_bundle = $js_bundle | fingerprint "md5" -}}
+    {{- $js_bundle = $js_bundle | js.Build (dict "format" "esm") | fingerprint "md5" -}}
+  {{- else -}}
+    {{- $js_bundle = $js_bundle | js.Build (dict "format" "esm" "sourceMap" "inline") -}}
   {{- end -}}
   <script src="{{ $js_bundle.RelPermalink }}"></script>
 

+ 3 - 1
wowchemy/layouts/partials/site_js.html

@@ -142,7 +142,9 @@
     {{- end -}}
     {{ $js_bundle := slice $js_bundle_head $js_bundle | resources.Concat (printf "%s/js/wowchemy.min.js" .Lang) }}
     {{- if hugo.IsProduction -}}
-      {{- $js_bundle = $js_bundle | fingerprint "md5" -}}
+      {{- $js_bundle = $js_bundle | js.Build (dict "format" "esm") | fingerprint "md5" -}}
+    {{- else -}}
+      {{- $js_bundle = $js_bundle | js.Build (dict "format" "esm" "sourceMap" "inline") -}}
     {{- end -}}
     <script src="{{ $js_bundle.RelPermalink }}"></script>
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно