contain-element/gulpfile.js

28 lines
772 B
JavaScript
Raw Normal View History

const gulp = require("gulp"),
ugly = require("gulp-uglify"),
2017-11-13 21:00:00 -05:00
concat = require("gulp-concat"),
insert = require("gulp-insert");
2015-06-30 16:50:22 -04:00
gulp.task("module", function() {
2017-11-13 21:00:00 -05:00
return gulp.src([ "contain-element.js" ])
.pipe(insert.transform(function(contents) {
return contents
.replace(/^function ContainElement/, "module.exports = function")
.replace(/\n\}/, "\n};");
}))
.pipe(concat("contain-element-module.js"))
.pipe(gulp.dest("./"));
});
gulp.task("minify", function() {
return gulp.src("contain-element.js")
.pipe(ugly())
.pipe(concat("contain-element.min.js"))
.pipe(gulp.dest("./"));
2015-06-30 16:50:22 -04:00
});
gulp.task("default", gulp.parallel(
"module",
"minify"
));