forked from heroku/nodejs-getting-started
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
32 lines (27 loc) · 701 Bytes
/
gulpfile.js
File metadata and controls
32 lines (27 loc) · 701 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
var gulp = require('gulp');
var webpack = require('gulp-webpack');
var webpackConfig = require('./webpack.config.js');
var env = require('gulp-env');
var nodemon = require('gulp-nodemon');
gulp.task('webpack', function () {
gulp.src(['./src/*.js'])
.pipe(webpack(webpackConfig))
.pipe(gulp.dest('./dist'));
});
gulp.task('watch', function () {
gulp.watch('./src/*.js', ['webpack']);
});
gulp.task('run', function () {
env({
file: '.env.json'
});
nodemon({
script: 'dist/app.js',
ext: 'js',
stdout: true,
env: {
NODE_ENV: 'development'
}
});
});
gulp.task('default', ['webpack', 'run', 'watch']);