mirror of
https://github.com/WilliamsNY/contain-element.git
synced 2024-11-21 13:52:32 -05:00
27 lines
772 B
JavaScript
27 lines
772 B
JavaScript
const gulp = require("gulp"),
|
|
ugly = require("gulp-uglify"),
|
|
concat = require("gulp-concat"),
|
|
insert = require("gulp-insert");
|
|
|
|
gulp.task("module", function() {
|
|
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("./"));
|
|
});
|
|
|
|
gulp.task("default", gulp.parallel(
|
|
"module",
|
|
"minify"
|
|
));
|