2016-06-29 10:27:04 +00:00
|
|
|
var webpack = require('webpack')
|
|
|
|
var WebpackDevServer = require('webpack-dev-server')
|
2018-03-01 18:39:36 +00:00
|
|
|
var config = require('./webpack.dev')
|
2016-06-29 10:27:04 +00:00
|
|
|
|
2017-08-28 13:32:37 +00:00
|
|
|
const PORT = process.env.PORT || 3000
|
|
|
|
|
2016-06-29 10:27:04 +00:00
|
|
|
new WebpackDevServer(webpack(config), {
|
2017-08-28 13:43:29 +00:00
|
|
|
disableHostCheck: true,
|
2016-06-29 10:27:04 +00:00
|
|
|
publicPath: config.output.publicPath,
|
|
|
|
hot: true,
|
2018-02-12 17:46:16 +00:00
|
|
|
headers: { 'Access-Control-Allow-Origin': '*' }, //for hot reloading
|
2016-06-29 10:27:04 +00:00
|
|
|
historyApiFallback: true,
|
2016-06-30 10:16:47 +00:00
|
|
|
// It suppress error shown in console, so it has to be set to false.
|
|
|
|
quiet: false,
|
|
|
|
// It suppress everything except error, so it has to be set to false as well
|
|
|
|
// to see success build.
|
|
|
|
noInfo: false,
|
2016-06-29 10:27:04 +00:00
|
|
|
stats: {
|
2016-06-30 10:16:47 +00:00
|
|
|
// Config for minimal console.log mess.
|
|
|
|
assets: false,
|
|
|
|
colors: true,
|
|
|
|
version: false,
|
|
|
|
hash: false,
|
|
|
|
timings: false,
|
|
|
|
chunks: false,
|
|
|
|
chunkModules: false
|
|
|
|
}
|
2018-01-03 15:54:19 +00:00
|
|
|
}).listen(PORT, '0.0.0.0', function(err) {
|
|
|
|
if (err) console.log(err) //eslint-disable-line no-console
|
|
|
|
console.log('Bonjour ! Je vous sers sur localhost:' + PORT) //eslint-disable-line no-console
|
2016-06-29 10:27:04 +00:00
|
|
|
})
|