-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
48 lines (40 loc) · 1.11 KB
/
gulpfile.babel.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
"use strict";
import gulp from "gulp";
import babel from "gulp-babel";
import del from "del";
import plumberNotifier from "gulp-plumber-notifier";
import jshint from "gulp-jshint";
import react from "react";
import rt from "gulp-react-templates";
var webpack = require('gulp-webpack');
/*
* Delete build files
*/
gulp.task("clean", () => {
return del([
"dist/**" // Distribution files
], { force: true });
});
gulp.task("copy-assets", ['clean'], () => {
return gulp
.src(["index.html", "**/*.css", "words.js"])
.pipe(gulp.dest("dist"));
});
/*
* Transcompile ES2015 to ES5
*/
gulp.task("pack", () => {
return gulp.src("js/app.js")
.pipe(jshint()) // check JS
.pipe(plumberNotifier()) // prevent pipe breaking when plugins generate errors
.pipe(webpack(require('./webpack.config.js') ))
.pipe(gulp.dest('dist'));
});
/*
* Watch for workspace changes and rebuild
*/
gulp.task("watch", () => {
gulp.watch("js/**/*.js", [ 'copy-assets', 'pack']);
});
/* Default gulp task */
gulp.task("default", ["clean", "copy-assets", "pack"]);