1
Fork 0

Don't bundle all JS into 1

This commit is contained in:
Jake Howard 2018-08-15 19:51:15 +01:00
parent e80b80652e
commit 3e98bd1af8
Signed by: jake
GPG key ID: 57AFB45680EDD477
5 changed files with 12 additions and 18 deletions

View file

@ -4,7 +4,7 @@
"dabapps/browser" "dabapps/browser"
], ],
"globals": { "globals": {
"mermaid": true "mermaid": true,
"$": true
} }
} }

View file

@ -21,8 +21,11 @@
{{ partial "footer.html" . }} {{ partial "footer.html" . }}
<script src='{{ relURL "/js/jquery.min.js" }}'></script>
<script src='{{ relURL "/js/lightgallery.js" }}'></script>
<script src='{{ relURL "/js/lg-thumbnail.min.js" }}'></script>
<script src='{{ relURL "/js/bootstrap.min.js" }}'></script>
<script src='{{ relURL "/js/mermaid.min.js" }}'></script> <script src='{{ relURL "/js/mermaid.min.js" }}'></script>
<script src='{{ relURL "/js/app.js" }}'></script> <script src='{{ relURL "/js/app.js" }}'></script>
</body> </body>
</html> </html>

View file

@ -12,6 +12,12 @@ hugo gen chromastyles --style=tango > $STATIC_SRC/scss/highlight.css
cp -r $BASEDIR/node_modules/lightgallery/dist/fonts $STATIC_BUILD cp -r $BASEDIR/node_modules/lightgallery/dist/fonts $STATIC_BUILD
cp -r $STATIC_SRC/img $STATIC_BUILD/img cp -r $STATIC_SRC/img $STATIC_BUILD/img
cp -r $BASEDIR/node_modules/lightgallery/dist/img/* $STATIC_BUILD/img cp -r $BASEDIR/node_modules/lightgallery/dist/img/* $STATIC_BUILD/img
cp -r $BASEDIR/node_modules/jquery/dist/jquery.min.js $STATIC_BUILD/js/jquery.min.js
cp -r $BASEDIR/node_modules/lightgallery/dist/js/lightgallery.js $STATIC_BUILD/js/lightgallery.js
cp -r $BASEDIR/node_modules/lg-thumbnail/dist/lg-thumbnail.min.js $STATIC_BUILD/js/lg-thumbnail.min.js
cp -r $BASEDIR/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js $STATIC_BUILD/js/bootstrap.min.js
parcel build $STATIC_SRC/js/index.js -d $STATIC_BUILD/js/ -o app.js parcel build $STATIC_SRC/js/index.js -d $STATIC_BUILD/js/ -o app.js
node-sass $STATIC_SRC/scss/style.scss $STATIC_BUILD/css/style.css --source-map-embed node-sass $STATIC_SRC/scss/style.scss $STATIC_BUILD/css/style.css --source-map-embed
cp $BASEDIR/node_modules/mermaid/dist/mermaid.min.js $STATIC_BUILD/js/mermaid.min.js cp $BASEDIR/node_modules/mermaid/dist/mermaid.min.js $STATIC_BUILD/js/mermaid.min.js

View file

@ -1,11 +1,6 @@
'use strict'; 'use strict';
var $ = require('./jquery-global');
require('./fa'); require('./fa');
require('bootstrap');
require('lightgallery/dist/js/lightgallery');
require('lg-thumbnail/dist/lg-thumbnail');
var Clipboard = require('clipboard'); var Clipboard = require('clipboard');

View file

@ -1,10 +0,0 @@
'use strict';
var jQuery = require('jquery');
window.$ = jQuery;
window.jQuery = jQuery;
global.$ = jQuery;
global.jQuery = jQuery;
module.exports = jQuery;