Fixed markup and usage of dependencies

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
Jim Martens 2019-02-27 10:51:17 +01:00
parent 2146f048dd
commit 89cbc438ae
2 changed files with 13 additions and 10 deletions

View File

@ -3,11 +3,12 @@
let dependencies = {};
dependencies.files = [
"./node_modules/echo-js/dist/echo",
"./node_modules/popper.js/dist/popper",
"./node_modules/bootstrap/js/dist/util",
"./node_modules/bootstrap/js/dist/collapse",
"./node_modules/bootstrap/js/dist/tooltip",
"~babel-polyfill/dist/polyfill",
"~echo-js/dist/echo",
"~popper.js/dist/popper",
"~bootstrap/js/dist/util",
"~bootstrap/js/dist/collapse",
"~bootstrap/js/dist/tooltip",
];
module.exports = dependencies;

View File

@ -22,6 +22,10 @@ const terser = require("gulp-terser");
// Include paths file.
const paths = require("./_assets/gulp_config/paths");
const dependencies = require("./_assets/gulp_config/dependencies");
const depfiles = dependencies.files.map(f => {
if (f[0] === "~") return `${f.replace("~", "./node_modules/")}.js`;
return `${paths.jsFiles}/${f}.js`;
});
// Uses Sass compiler to process styles, adds vendor prefixes, minifies, then
// outputs file to the appropriate location.
@ -63,13 +67,11 @@ gulp.task("clean:styles", function () {
// Concatenates and uglifies global JS files and outputs result to the
// appropriate location.
gulp.task("build:scripts:global", function () {
return gulp.src([
"node_modules/babel-polyfill/dist/polyfill.js",
dependencies.files,
paths.jsFiles + "/global/lib" + paths.jsPattern,
return gulp.src(depfiles.concat([
//paths.jsFiles + "/global/lib" + paths.jsPattern,
paths.jsFiles + "/global/*.js",
paths.jsFiles + "/main.js"
]).pipe(sourcemaps.init({largeFile: true}))
])).pipe(sourcemaps.init({largeFile: true}))
.pipe(babel({
presets: ["@babel/env"]
}))