remove env variable in npm scrpts; rename watch script for clarity
This commit is contained in:
33
watch.js
Normal file
33
watch.js
Normal 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'
|
||||
]
|
||||
});
|
||||
Reference in New Issue
Block a user