-
Notifications
You must be signed in to change notification settings - Fork 8
/
gulpfile.js
48 lines (48 loc) · 1.73 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
// Generated by LiveScript 1.5.0
(function(){
var gulp, sass, src, ref$, ref1$, watch, split$ = ''.split;
gulp = require('gulp');
sass = require('gulp-dart-sass');
src = function(it){
return gulp.src(it);
};
if ((ref$ = (ref1$ = process.argv)[ref1$.length - 1]) === 'run' || ref$ === 'dev') {
watch = require('gulp-watch');
src = function(it){
return gulp.src(it).pipe(watch(it));
};
}
gulp.task('sass', function(){
return src('./sass/*.scss').pipe(sass()).pipe(require('gulp-postcss')([
require('autoprefixer-core')({
browsers: ['last 1 version']
}), require('css-mqpacker'), require('csswring')
])).pipe(gulp.dest('.'));
});
gulp.task('static-here', function(){
var ref$;
(ref$ = process.argv)[ref$.length - 1] = '8888';
return require('./static-here.js');
});
gulp.task('show-url', function(){
return setTimeout(function(){
return console.log("\n===> http://127.0.0.1:8888/");
}, 2000);
});
gulp.task('webpack:build', function(it){
var webpack;
process.env.NODE_ENV = 'production';
webpack = require('webpack');
return webpack(require('./webpack.config.js'), it);
});
gulp.task('webpack:dev', function(){
process.env.NODE_ENV = 'development';
process.argv = split$.call(process.argv, 'dev');
process.argv = process.argv.concat(['--hot', '--port', '8888', '--host', '0.0.0.0']);
return require('./node_modules/webpack-dev-server/bin/webpack-dev-server.js');
});
gulp.task('default', gulp.series('sass'));
gulp.task('build', gulp.series('default', 'webpack:build'));
gulp.task('run', gulp.series('default', 'static-here', 'show-url'));
gulp.task('dev', gulp.series('default', 'webpack:dev', 'show-url'));
}).call(this);