Files
bedrock/watch.js
Patrick Vézina 7623ad0511 Set dynamically aboslute public path on 'npm run watch'; fix http/htt… (#1696)
* Set dynamically aboslute public path on 'npm run watch'; fix http/https hardcoded in watch.js

* WEBPACK_PUBLIC_PATH fix
2016-08-26 11:45:50 -06:00

34 lines
787 B
JavaScript

// External dependencies
var webpack = require('webpack'),
webpackDevMiddleware = require('webpack-dev-middleware'),
webpackHotMiddleware = require('webpack-hot-middleware'),
browserSync = require('browser-sync');
// Internal dependencies
var webpackConfig = require('./webpack.config'),
config = require('./assets/config');
// Internal variables
var compiler = webpack(webpackConfig);
browserSync.init({
proxy: {
target: config.devUrl,
middleware: [
webpackDevMiddleware(compiler, {
publicPath: webpackConfig.output.publicPath,
stats: {
colors: true
}
}),
webpackHotMiddleware(compiler, {
log: browserSync.notify
})
]
},
files: [
'templates/**/*.php',
'src/**/*.php'
]
});