Don't bundle all JS into 1
This commit is contained in:
parent
e80b80652e
commit
3e98bd1af8
5 changed files with 12 additions and 18 deletions
|
@ -4,7 +4,7 @@
|
|||
"dabapps/browser"
|
||||
],
|
||||
"globals": {
|
||||
"mermaid": true
|
||||
|
||||
"mermaid": true,
|
||||
"$": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,11 @@
|
|||
|
||||
{{ 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/app.js" }}'></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -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 $STATIC_SRC/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
|
||||
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
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
var $ = require('./jquery-global');
|
||||
require('./fa');
|
||||
require('bootstrap');
|
||||
|
||||
require('lightgallery/dist/js/lightgallery');
|
||||
require('lg-thumbnail/dist/lg-thumbnail');
|
||||
|
||||
var Clipboard = require('clipboard');
|
||||
|
||||
|
|
10
static/src/js/jquery-global.js
vendored
10
static/src/js/jquery-global.js
vendored
|
@ -1,10 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
var jQuery = require('jquery');
|
||||
|
||||
window.$ = jQuery;
|
||||
window.jQuery = jQuery;
|
||||
global.$ = jQuery;
|
||||
global.jQuery = jQuery;
|
||||
|
||||
module.exports = jQuery;
|
Loading…
Reference in a new issue