Bundle admin scripts, remove CDN scripts (#6122)

Close #6120
v1.18.x
Peter Jaszkowiak 7 years ago committed by Barış Soner Uşaklı
parent 847a3132fa
commit 9b11413d14

@ -52,6 +52,7 @@
"lodash": "^4.17.4",
"logrotate-stream": "^0.2.5",
"lru-cache": "4.1.1",
"material-design-lite": "^1.3.0",
"mime": "^2.0.3",
"mkdirp": "^0.5.1",
"mongodb": "2.2.33",

@ -7,20 +7,7 @@
(function (factory) {
"use strict";
if (typeof define === "function" && define.amd) {
define(factory);
}
else if (typeof module != "undefined" && typeof module.exports != "undefined") {
module.exports = factory();
}
else if (typeof Package !== "undefined") {
Sortable = factory(); // export for Meteor.js
}
else {
/* jshint sub:true */
window["Sortable"] = factory();
}
window.Sortable = factory();
})(function () {
"use strict";

@ -76,6 +76,19 @@ JS.scripts = {
'public/src/modules/storage.js',
],
admin: [
'node_modules/material-design-lite/material.js',
'public/vendor/jquery/sortable/Sortable.js',
'public/vendor/colorpicker/colorpicker.js',
'public/src/admin/admin.js',
'public/vendor/semver/semver.browser.js',
'public/vendor/jquery/serializeObject/jquery.ba-serializeobject.min.js',
'public/vendor/jquery/deserialize/jquery.deserialize.min.js',
'public/vendor/snackbar/snackbar.min.js',
'public/vendor/slideout/slideout.min.js',
'public/vendor/nprogress.min.js',
],
// modules listed below are built (/src/modules) so they can be defined anonymously
modules: {
'Chart.js': 'node_modules/chart.js/dist/Chart.min.js',
@ -299,13 +312,15 @@ function getBundleScriptList(target, callback) {
return callback(err);
}
var scripts = JS.scripts.base.concat(pluginScripts);
var scripts = JS.scripts.base;
if (target === 'client' && global.env !== 'development') {
scripts = scripts.concat(JS.scripts.rjs);
} else if (target === 'acp') {
scripts = scripts.concat(JS.scripts.admin);
}
scripts = scripts.map(function (script) {
scripts = scripts.concat(pluginScripts).map(function (script) {
var srcPath = path.resolve(basePath, script).replace(/\\/g, '/');
return {
srcPath: srcPath,

@ -19,17 +19,7 @@
};
</script>
<script src="https://storage.googleapis.com/code.getmdl.io/1.3.0/material.min.js"></script>
<script type="text/javascript" src="{relative_path}/assets/vendor/jquery/sortable/Sortable.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/assets/acp.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/assets/vendor/colorpicker/colorpicker.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/assets/src/admin/admin.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/assets/vendor/semver/semver.browser.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/assets/vendor/jquery/serializeObject/jquery.ba-serializeobject.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/assets/vendor/jquery/deserialize/jquery.deserialize.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/assets/vendor/snackbar/snackbar.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/assets/vendor/slideout/slideout.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/assets/vendor/nprogress.min.js?{cache-buster}"></script>
<!-- BEGIN scripts -->
<script type="text/javascript" src="{scripts.src}"></script>

Loading…
Cancel
Save