-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
50 lines (41 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
50
/// <binding Clean='clean' />
"use strict";
var gulp = require("gulp"),
rimraf = require("rimraf"),
concat = require("gulp-concat"),
cssmin = require("gulp-cssmin"),
uglify = require("gulp-uglify"),
rename = require('gulp-rename');
var webroot = "./wwwroot/";
var paths = {
js: webroot + "js/**/*.js",
minJs: webroot + "js/**/*.min.js",
pathJs: webroot + "js/",
css: webroot + "css/**/*.css",
minCss: webroot + "css/**/*.min.css",
pathCss: webroot + "css/"
};
gulp.task("clean:js", function (cb) {
rimraf(paths.minJs, cb);
});
gulp.task("clean:css", function (cb) {
rimraf(paths.minCss, cb);
});
gulp.task("clean", ["clean:js", "clean:css"]);
gulp.task("min:js", function () {
return gulp.src([paths.js, "!" + paths.minJs], { base: "." })
.pipe(rename({
suffix: '.min'
}))
.pipe(uglify())
.pipe(gulp.dest(paths.pathJs));
});
gulp.task("min:css", function () {
return gulp.src([paths.css, "!" + paths.minCss])
.pipe(rename({
suffix: '.min'
}))
.pipe(cssmin())
.pipe(gulp.dest(paths.pathCss));
});
gulp.task("min", ["min:js", "min:css"]);