-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
60 lines (50 loc) · 1.19 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
58
59
60
var gulp = require("gulp"),
cssimport = require("gulp-cssimport"),
cssnano = require('gulp-cssnano'),
rjs = require('gulp-requirejs'),
uglify = require('gulp-uglify');
// source = require('vinyl-source-stream'),
var options = {
extensions: ["css"] // process only css
};
gulp.task('import', function() {
return gulp.src('./public/dev_css/*.css')
.pipe(cssimport(options))
.pipe(cssnano())
.pipe(gulp.dest('public/css/*.css'));
});
// build js for editArticle
gulp.task('eA_js', function (cb) {
rjs({
name: 'editArticle',
baseUrl: './public/js/',
out: 'editArticle.js'
})
.pipe(uglify())
.pipe(gulp.dest('./public/js/build'));
cb();
});
// build js for edit_remove
gulp.task('eR_js', function (cb) {
rjs({
name: 'edit_remove',
baseUrl: './public/js/',
out: 'edit_remove.js'
})
.pipe(uglify())
.pipe(gulp.dest('./public/js/build'));
cb();
});
// build js for newArticle
gulp.task('nA_js', function (cb) {
rjs({
name: 'newArticle',
baseUrl: './public/js/',
out: 'newArticle.js'
})
.pipe(uglify())
.pipe(gulp.dest('./public/js/build'));
cb();
});
gulp.task('buildJS', gulp.series(['eA_js', 'eR_js', 'nA_js']))
gulp.task('default', gulp.series('import'));