Browse Source

Swap out parcel for esbuild

dependabot/npm_and_yarn/ini-1.3.8
Jake Howard 3 months ago
parent
commit
3053dc6656
Signed by: theorangeone GPG Key ID: 57AFB45680EDD477
  1. 6
      layouts/_default/baseof.html
  2. 9
      layouts/partials/script.html
  3. 9
      layouts/partials/script_async.html
  4. 9686
      package-lock.json
  5. 3
      package.json
  6. 11
      scripts/build.sh

6
layouts/_default/baseof.html

@ -31,13 +31,13 @@
{{ partial "footer.html" . }}
{{ partial "script.html" "js/jquery.js" }}
{{ partial "script.html" "js/jquery.min.js" }}
{{ if eq .Params.layout "flickr" }}
{{ partial "script_async.html" "js/lightgallery.js" }}
{{ partial "script_async.html" "js/lightgallery.min.js" }}
{{ end }}
{{ partial "script_async.html" "js/bootstrap.js" }}
{{ partial "script_async.html" "js/bootstrap.min.js" }}
{{ partial "script_async.html" "js/app.js" }}

9
layouts/partials/script.html

@ -1,2 +1,9 @@
{{ $script := resources.Get . | minify | fingerprint }}
{{ $script := resources.Get . }}
{{ if in . "min" }}
{{ $script = $script | minify | fingerprint }}
{{ else }}
{{ $script = $script | js.Build (dict "minify" true) | fingerprint }}
{{ end }}
<script type="text/javascript" src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>

9
layouts/partials/script_async.html

@ -1,2 +1,9 @@
{{ $script := resources.Get . | minify | fingerprint }}
{{ $script := resources.Get . }}
{{ if in . "min" }}
{{ $script = $script | minify | fingerprint }}
{{ else }}
{{ $script = $script | js.Build (dict "minify" true) | fingerprint }}
{{ end }}
<script type="text/javascript" async src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>

9686
package-lock.json
File diff suppressed because it is too large
View File

3
package.json

@ -19,7 +19,6 @@
"elevator.js": "1.0.1",
"jquery": "3.5.1",
"lg-thumbnail": "1.1.0",
"lightgallery": "1.8.0",
"parcel-bundler": "1.12.4"
"lightgallery": "1.8.0"
}
}

11
scripts/build.sh

@ -7,7 +7,9 @@ source ./scripts/common.sh
rm -rf $OUTPUT_DIR
rm -rf $STATIC_BUILD
rm -rf $BASEDIR/resources
mkdir -p $STATIC_BUILD/js $STATIC_BUILD/css $STATIC_BUILD/audio
cp -r $BASEDIR/node_modules/lightgallery/dist/fonts $STATIC_BUILD
cp -r $STATIC_SRC/img $STATIC_BUILD/img
cp -r $BASEDIR/node_modules/lightgallery/dist/img/* $STATIC_BUILD/img
@ -15,13 +17,12 @@ cp -r $BASEDIR/node_modules/@fortawesome/fontawesome-free/css/all.min.css $STATI
cp $BASEDIR/node_modules/lightgallery/dist/css/lightgallery.min.css $STATIC_BUILD/css/lightgallery.css
cp -r $BASEDIR/node_modules/@fortawesome/fontawesome-free/webfonts $STATIC_BUILD
cp $BASEDIR/node_modules/jquery/dist/jquery.min.js $STATIC_BUILD/js/jquery.js
cp $BASEDIR/node_modules/lightgallery/dist/js/lightgallery-all.min.js $STATIC_BUILD/js/lightgallery.js
cp $BASEDIR/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js $STATIC_BUILD/js/bootstrap.js
cp $STATIC_SRC/js/app.js $STATIC_BUILD/js/app.js
cp $BASEDIR/node_modules/jquery/dist/jquery.min.js $STATIC_BUILD/js/jquery.min.js
cp $BASEDIR/node_modules/lightgallery/dist/js/lightgallery-all.min.js $STATIC_BUILD/js/lightgallery.min.js
cp $BASEDIR/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js $STATIC_BUILD/js/bootstrap.min.js
cp $BASEDIR/node_modules/elevator.js/demo/music/*.mp3 $STATIC_BUILD/audio/
parcel build --no-source-maps -d $STATIC_BUILD/js/ $STATIC_SRC/js/app.js
cp -r $STATIC_SRC/scss $STATIC_BUILD/scss
hugo gen chromastyles --style=monokai > $STATIC_BUILD/css/highlight.css

Loading…
Cancel
Save