forked from osuthailand/hanayo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (45 loc) · 1.17 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
var gulp = require("gulp")
var chug = require("gulp-chug")
var plumber = require("gulp-plumber")
var uglify = require("gulp-uglify")
var flatten = require("gulp-flatten")
var concat = require("gulp-concat")
var babel = require("gulp-babel")
gulp.task("default", ["build"])
gulp.task("build", [
"minify-js",
])
gulp.task("watch", function() {
gulp.watch(["static/*.js", "!static/dist.min.js"], ["minify-js"])
gulp.watch("semantic/src/**/*", ["build-semantic"])
})
gulp.task("build-semantic", function() {
gulp.src("./semantic/gulpfile.js")
.pipe(chug({
tasks: ['build']
}))
})
gulp.task("minify-js", function() {
gulp
.src([
"static/licenseheader.js",
"node_modules/jquery/dist/jquery.min.js",
"node_modules/timeago/jquery.timeago.js",
"static/semantic.min.js",
"node_modules/i18next/i18next.min.js",
"node_modules/i18next-xhr-backend/i18nextXHRBackend.min.js",
"static/key_plural.js",
"static/ripple.js",
])
.pipe(plumber())
.pipe(concat("dist.min.js"))
/*.pipe(babel({
presets: ["latest"]
})) breaks vue */
.pipe(flatten())
.pipe(uglify({
mangle: true,
preserveComments: "license"
}))
.pipe(gulp.dest("./static"))
})