-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
45 lines (32 loc) · 979 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
38
39
40
41
42
43
/**
* Created by wmj on 2015/12/17.
*/
var uglify = require('gulp-uglify'),
gulp = require('gulp'),
sourceMap = require('gulp-sourcemaps'),
webpack=require('webpack'),
webpackDevServer=require('webpack-dev-server'),
config=require('./webpack.config');
gulp.task('minify:js', function () {
gulp.src('src/js/bundles/**/*.js')
.pipe(sourceMap.init())
.pipe(uglify())
.pipe(sourceMap.write('../../src/js/source_maps'))
.pipe(gulp.dest('build/js'))
});
gulp.task('server',function(){
new webpackDevServer(webpack(config),{
publicPath:config.output.publicPath,
hot:true,
quiet:false,
historyApiFallback:true,
noInfo:false,
stats:{color:true}
}).listen(8080,'localhost',function(err,result){
if(err)
{
console.log(err);
}
console.log('Listening at localhost:8080');
})
});