-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
49 lines (41 loc) · 1.3 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
var gulp = require('gulp');
var gutil = require("gulp-util");
var webpack = require("gulp-webpack");
var WebpackDevServer = require("webpack-dev-server");
var livereload = require('gulp-livereload');
var del = require('del');
var webpackConfig = require("./webpack.config.js");
gulp.task('default', function() {
// place code for your default task here
// });
});
gulp.task('clean', function (cb) {
del(['dist/**'], cb);
});
gulp.task('watch', function(cb) {
// body...
});
gulp.task('webpack', function() {
return gulp.src('')
.pipe(webpack(webpackConfig))
.pipe(gulp.dest('dist/assets/'));
});
gulp.task('copy', function() {
gulp.src(['src/index.html', 'src/favicon.ico'])
.pipe(gulp.dest('dist/'));
gulp.src([
'src/styles/main.css',
'bower_components/bootstrap/dist/css/bootstrap.css',
'bower_components/bootstrap/dist/css/bootstrap.css.map',
])
.pipe(gulp.dest('dist/assets'));
gulp.src([
'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff',
'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
])
.pipe(gulp.dest('dist/fonts'));
});
gulp.task('build', ['copy', 'webpack']);
gulp.task('watch', function () {
gulp.watch(['src/index.html', 'src/scripts/**/*', 'src/styles/**/*'], ['build']);
});