🔧 Chore: modify babel config and optimize theme.js compilation and loading

This commit is contained in:
Cell
2022-08-05 17:20:05 +08:00
parent 08374c06e8
commit dce144e4b6
7 changed files with 12 additions and 1496 deletions
+2
View File
@@ -1,4 +1,6 @@
{
"comments": false,
"minified": true,
"presets": [
[
"@babel/preset-env",
+1
View File
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## v0.2.16
- :wrench: Chore: modify babel config and optimize theme.js compilation and loading
- **Full Changelog:** @Lruihao [`v0.2.15...v0.2.16`](https://github.com/hugo-fixit/FixIt/compare/v0.2.15...v0.2.16)
## v0.2.15 [2022.8.4]
-1493
View File
File diff suppressed because it is too large Load Diff
+3
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -250,7 +250,8 @@
{{- $config | jsonify | printf "window.config=%s;" | dict "Content" | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- /* Theme script */ -}}
{{- dict "Source" "js/theme.js" "Minify" true "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- dict "Source" "js/theme.min.js" "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $_ := (resources.Get "js/theme.min.js.map").RelPermalink -}}
{{- /* Custom script */ -}}
{{- if eq .Site.Params.customJS.enable true -}}
+3 -2
View File
@@ -18,9 +18,10 @@
},
"scripts": {
"preinstall": "npx npm-force-resolutions",
"babel": "npx babel src/js/theme.js --out-file assets/js/theme.js",
"babel": "npx babel src/js/theme.js -o assets/js/theme.min.js -s",
"build": "npm run babel && hugo -v --source=docs --gc --minify",
"build-lunr-segmentit": "browserify src/lib/lunr.segmentit.js -o assets/lib/lunr/lunr.segmentit.js -t babelify --presets @babel/preset-env --presets minify",
"build:vercel": "npm run babel && hugo -v --source=docs --theme $PWD $BUILD_DRAFTS --gc --minify",
"build:lunr.segmentit": "browserify src/lib/lunr.segmentit.js -o assets/lib/lunr/lunr.segmentit.js -t babelify --presets @babel/preset-env --presets minify",
"server": "hugo server --source=docs -D --disableFastRender --navigateToChanged --ignoreCache",
"server:production": "hugo server --source=docs -D --disableFastRender --navigateToChanged --ignoreCache -e production",
"start": "npm run babel && npm run server",