Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: node_js
node_js:
- "8"
- "9"
- "10"
Binary file modified dist/dotdom.min.br
Binary file not shown.
Binary file modified dist/dotdom.min.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/dotdom.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed dist/dotdom.min.js.gz
Binary file not shown.
Binary file modified dist/plugin-keyed.min.br
Binary file not shown.
63 changes: 39 additions & 24 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const gzip = require("gulp-gzip");
const brotli = require("gulp-brotli");

const babel = require("gulp-babel");
const uglify = require("gulp-uglify-es").default;
const uglify = require("gulp-terser");

const clone = require("gulp-clone");
const gulpMerge = require("gulp-merge");
Expand All @@ -19,6 +19,9 @@ const useBrotli = process.env.ENABLE_BROTLI || false;

const uglifyOptions = {
ecma: 6,
compress: {
passes: 2,
},
mangle: {
reserved: [],
toplevel: true
Expand Down Expand Up @@ -86,6 +89,18 @@ const getBaseStream = (src) => {
);
};

// /**
// * Trims the tailing ';' to save an extra byte
// */
// const pprint = (what) => {
// function filter(file, enc, cb) {
// console.log(what);
// cb(null, file);
// }

// return through.obj(filter);
// };

/**
* Wraps the input stream with uglify
*/
Expand Down Expand Up @@ -187,7 +202,7 @@ gulp.task("build:plugins:js", () => {
));

args.push(null);
return gulpMerge.apply(null, args);
return Promise.resolve(gulpMerge.apply(null, args));
});

gulp.task("build:plugins:gz", () => {
Expand All @@ -197,37 +212,37 @@ gulp.task("build:plugins:gz", () => {
));

args.push(null);
return gulpMerge.apply(null, args);
return Promise.resolve(gulpMerge.apply(null, args));
});

gulp.task("build:js", () => {
return getBuildSource(
return Promise.resolve(getBuildSource(
"src/dotdom.js",
"dotdom.min"
);
));
});

gulp.task("build:gz", () => {
return getBuildCompressed(
return Promise.resolve(getBuildCompressed(
"src/dotdom.js",
"dotdom.min"
);
});

gulp.task("build:plugins", ["build:plugins:js", "build:plugins:gz"]);
gulp.task("build", ["build:js", "build:gz", "build:plugins"]);

gulp.task("watch", () => {
const watcher = gulp.watch("./src/**/*.js", ["build:js"]);
watcher.on("change", function(event) {
gutil.log(
"File",
gutil.colors.magenta(event.path),
"was",
gutil.colors.cyan(event.type)
);
});
return watcher;
));
});

gulp.task("default", ["build", "watch"]);
gulp.task("build:plugins", gulp.series("build:plugins:js", "build:plugins:gz"));
gulp.task("build", gulp.series("build:js", "build:gz", "build:plugins"));

// gulp.task("watch", () => {
// const watcher = gulp.watch("./src/**/*.js", ["build:js"]);
// watcher.on("change", function(event) {
// gutil.log(
// "File",
// gutil.colors.magenta(event.path),
// "was",
// gutil.colors.cyan(event.type)
// );
// });
// return watcher;
// });

gulp.task("default", gulp.series("build"));
Loading