forked from dowjones/gulp-bundle-assets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
42 lines (38 loc) · 1.06 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
var gulp = require('gulp'),
rimraf = require('gulp-rimraf'),
livereload = require('gulp-livereload'),
path = require('path'),
gbundle = require('../../index');
process.env.NODE_ENV = 'production'; // hardcode to always run in production mode
gulp.task('bundle', ['clean'], function () {
return gulp.src('./bundle.config.js')
.pipe(gbundle({
//bundleAllEnvironments: true,
//quietMode: true
}))
.pipe(gbundle.results({
dest: './',
pathPrefix: '/public/',
fileName: 'manifest'
}))
.pipe(gulp.dest('./public'));
});
gulp.task('watch', function () {
livereload.listen();
gulp.watch(['./public/*.*']).on('change', livereload);
gbundle.watch({
//bundleAllEnvironments: true,
//quietMode: true,
configPath: path.join(__dirname, 'bundle.config.js'),
results: {
dest: __dirname,
pathPrefix: '/public/',
fileName: 'manifest'
},
dest: path.join(__dirname, 'public')
});
});
gulp.task('clean', function () {
return gulp.src('./public', { read: false })
.pipe(rimraf());
});