mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🔧 Chore: modify babel config and optimize theme.js compilation and loading
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"comments": false,
|
||||
"minified": true,
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
Vendored
+3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user