remove env variable in npm scrpts; rename watch script for clarity

This commit is contained in:
Patrick Vézina
2016-03-15 22:14:04 -04:00
parent 8e2aeb53ab
commit 9bb62336a8
3 changed files with 6 additions and 5 deletions

33
watch.js Normal file
View File

@@ -0,0 +1,33 @@
/* eslint no-console: 0 */
process.env.SCRIPT = 'watch';
var webpack = require('webpack'),
webpackDevMiddleware = require('webpack-dev-middleware'),
webpackHotMiddleware = require('webpack-hot-middleware'),
browserSync = require('browser-sync');
var devBuildConfig = require('./webpack.config'),
config = require('./config'),
compiler = webpack(devBuildConfig);
browserSync.init({
proxy: {
target: config.devUrl,
middleware: [
webpackDevMiddleware(compiler, {
publicPath: devBuildConfig.output.publicPath,
stats: {
colors: true
},
}),
webpackHotMiddleware(compiler, {
log: browserSync.notify
})
]
},
files: [
'templates/**/*.php',
'src/**/*.php'
]
});