Fixed markup and usage of dependencies

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2019-02-27 10:51:17 +01:00
parent 2146f048dd
commit 89cbc438ae
2 changed files with 13 additions and 10 deletions
+6 -5
View File
@@ -3,11 +3,12 @@
let dependencies = {}; let dependencies = {};
dependencies.files = [ dependencies.files = [
"./node_modules/echo-js/dist/echo", "~babel-polyfill/dist/polyfill",
"./node_modules/popper.js/dist/popper", "~echo-js/dist/echo",
"./node_modules/bootstrap/js/dist/util", "~popper.js/dist/popper",
"./node_modules/bootstrap/js/dist/collapse", "~bootstrap/js/dist/util",
"./node_modules/bootstrap/js/dist/tooltip", "~bootstrap/js/dist/collapse",
"~bootstrap/js/dist/tooltip",
]; ];
module.exports = dependencies; module.exports = dependencies;
+7 -5
View File
@@ -22,6 +22,10 @@ const terser = require("gulp-terser");
// Include paths file. // Include paths file.
const paths = require("./_assets/gulp_config/paths"); const paths = require("./_assets/gulp_config/paths");
const dependencies = require("./_assets/gulp_config/dependencies"); 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 // Uses Sass compiler to process styles, adds vendor prefixes, minifies, then
// outputs file to the appropriate location. // 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 // Concatenates and uglifies global JS files and outputs result to the
// appropriate location. // appropriate location.
gulp.task("build:scripts:global", function () { gulp.task("build:scripts:global", function () {
return gulp.src([ return gulp.src(depfiles.concat([
"node_modules/babel-polyfill/dist/polyfill.js", //paths.jsFiles + "/global/lib" + paths.jsPattern,
dependencies.files,
paths.jsFiles + "/global/lib" + paths.jsPattern,
paths.jsFiles + "/global/*.js", paths.jsFiles + "/global/*.js",
paths.jsFiles + "/main.js" paths.jsFiles + "/main.js"
]).pipe(sourcemaps.init({largeFile: true})) ])).pipe(sourcemaps.init({largeFile: true}))
.pipe(babel({ .pipe(babel({
presets: ["@babel/env"] presets: ["@babel/env"]
})) }))