forked from pioul/Minimalist-Markdown-Editor-for-Chrome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
30 lines (26 loc) · 783 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var gulp = require("gulp"),
del = require("del"),
babel = require("gulp-babel");
gulp.task("clean", function(c) {
del("dist/**", c);
});
// Transpile to ES5
// Input: All JS files but those under libs/
gulp.task("to-ES5", ["clean"], function() {
return gulp.src([
"src/**/*.js",
"!src/**/libs/**"
], { base: "src/" })
.pipe(babel())
.pipe(gulp.dest("dist/"));
});
// Simply copy the rest of the files from src/ to dist/
// Input: All files but JS files that are not under libs/
gulp.task("copy", ["clean"], function() {
return gulp.src([
"src/**",
"!src/**/!(libs)/*.js" // With this glob, JS files must be directly under libs/ (change the glob if nesting folders)
], { base: "src/" })
.pipe(gulp.dest("dist/"));
});
gulp.task("default", ["to-ES5", "copy"]);