-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
31 lines (28 loc) · 909 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
31
const gulp = require("gulp")
const concat = require("gulp-concat")
const terser = require("gulp-terser")
const sourcemaps = require("gulp-sourcemaps")
const postcss = require("gulp-postcss")
const cssnano = require("cssnano")
const autoprefixer = require("autoprefixer")
const {src, sories, parallel, dest, watch} = require("gulp")
const jsPath = "static/js/*.js"
const cssPath = "static/css/*.css"
function jsMinify() {
return src(jsPath)
.pipe(sourcemaps.init())
.pipe(concat("all.js"))
.pipe(terser())
.pipe(sourcemaps.write("."))
.pipe(dest("static/js"))
}
function cssMinify() {
return src(cssPath)
.pipe(sourcemaps.init())
.pipe(concat("style_min.css"))
.pipe(postcss([autoprefixer(), cssnano()]))
.pipe(sourcemaps.write("."))
.pipe(dest("static/css"))
}
exports.jsMinify = jsMinify
exports.cssMinify = cssMinify