-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (36 loc) · 919 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
const gulp = require('gulp'),
rollup = require('rollup-stream'),
babel = require("rollup-plugin-babel"),
uglify = require('rollup-plugin-uglify'),
source = require('vinyl-source-stream');
gulp.task('default', ['watch']);
gulp.task('js', () => {
return rollup({
entry: './source/js/assorted.js',
format: 'iife',
moduleName: 'Assorted',
plugins: [
babel({
exclude: 'node_modules/**'
})
]
}).pipe(source('assorted.js'))
.pipe(gulp.dest('./dist/js'))
});
gulp.task('js:production', () => {
return rollup({
entry: './source/js/assorted.js',
format: 'iife',
moduleName: 'Assorted',
plugins: [
babel({
exclude: 'node_modules/**'
}),
uglify()
]
}).pipe(source('assorted.min.js'))
.pipe(gulp.dest('./dist/js'))
});
gulp.task('watch', () => {
gulp.watch('source/js/*.js', ['js', 'js:production']);
});