-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
47 lines (39 loc) · 939 Bytes
/
gulpfile.js
File metadata and controls
47 lines (39 loc) · 939 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'use strict';
const clean = require('gulp-clean');
var gulp = require('gulp');
var webpack = require('webpack-stream');
const paths = {
js: __dirname + '/app/**/*.js',
html: __dirname + '/app/index.html',
css: __dirname + '/app/css/style.css'
};
// gulp.task('clean', ()=>{
// gulp.src('./build/*')
// .pipe(clean());
// });
gulp.task('copy', ()=>{
gulp.src(paths.html)
.pipe(gulp.dest('./build'));
gulp.src(paths.css)
.pipe(gulp.dest('./build'));
});
gulp.task('bundle', ()=>{
gulp.src(paths.js)
.pipe(webpack({
output: {
filename: 'bundle.js'
}
}))
.pipe(gulp.dest('./build'));
});
gulp.task('bundle:test', () => {
return gulp.src(__dirname + '/test/*_test.js')
.pipe(webpack({
output: {
filename: 'test_bundle.js'
}
}))
.pipe(gulp.dest(__dirname + '/test'));
});
gulp.task('build', ['copy', 'bundle']);
gulp.task('default', ['build']);