forked from juacas/quizaccess_delayed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
57 lines (56 loc) · 1.47 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const gulp = require("gulp");
const babel = require("gulp-babel");
const uglify = require("gulp-uglify");
const rename = require("gulp-rename");
const sourcemaps = require("gulp-sourcemaps");
const GulpClient = require("gulp");
const watch = require("gulp-watch");
const paths = {
source: "./amd/src",
destination: "./amd/build",
};
gulp.task("watch-folder", function() {
return gulp
.src(paths.source + "/*.js", { base: paths.source })
.pipe(watch(paths.source, { base: paths.source }))
.pipe(
rename(function (path) {
path.extname = ".min.js";
})
)
.pipe(gulp.dest(paths.destination));
});
gulp.task("copy", function() {
return gulp
.src(paths.source + "/*.js")
.pipe(
rename(function (path) {
path.extname = ".min.js";
})
)
.pipe(gulp.dest(paths.destination));
});
gulp.task("default", function () {
return (
gulp
.src(paths.source + "/*.js")
// .pipe(eslint())
// .pipe(eslint.format())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(
babel({
presets: ["@babel/preset-env"],
})
)
// .pipe(gulp.dest(paths.destination + "/dist/babel"))
.pipe(uglify())
.pipe(
rename(function (path) {
path.extname = ".min.js";
})
)
// .pipe(gulp.dest(paths.destination + "/dist/uglify"))
.pipe(sourcemaps.write("./"))
.pipe(gulp.dest(paths.destination))
);
});