forked from huiyan-fe/mapV-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (30 loc) · 857 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
32
33
34
35
36
37
/**
* @file gulpfile
* @test
*/
/* globals process */
const env = process.env.NODE_ENV || 'production';
console.log(env);
const gulp = require('gulp');
const sass = require('gulp-sass');
gulp.task('page', () => {
gulp.src('src/page/*.*')
.pipe(gulp.dest('./dist/'));
});
gulp.task('sass', () =>
gulp.src('./src/scss/**/{*.scss,!_*.scss}')
.pipe(sass({
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(gulp.dest('./dist/static/css'))
);
gulp.task('static', () => {
gulp.src(['src/static/**/{*.*,!*.scss}'])
.pipe(gulp.dest('./dist/static'));
});
if (env === 'development') {
gulp.watch('src/page/*.*', ['page']);
gulp.watch('src/scss/**/{*.scss,!_*.scss}', ['sass']);
gulp.watch('src/static/**/{*.*,!*.scss}', ['static']);
}
gulp.task('default', ['page', 'sass', 'static']);