-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
28 lines (24 loc) · 741 Bytes
/
gulpfile.js
File metadata and controls
28 lines (24 loc) · 741 Bytes
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
const gulp = require('gulp');
const gutil = require('gulp-util');
const webpack = require('webpack-stream');
gulp.task('assets', function() {
return gulp.src('public/*')
.pipe(gulp.dest('dist/'));
});
gulp.task('javascript', function() {
return gulp.src('src/index.js')
.pipe(webpack(require('./webpack.config.js')))
.pipe(gulp.dest('dist/'));
});
gulp.task('dev', function(done) {
gulp.watch('public/*', ['assets']);
const WebpackDevServer = require("webpack-dev-server");
webpack(require('./webpack.dev.config.js')).run(function(err, stats) {
if (err) {
throw new gutil.PluginError("dev", err);
}
gutil.log("[dev]", stats.toString({colors: true}));
done();
});
});
gulp.task('default', ['assets', 'javascript']);