mon-entreprise/source/server.js

32 lines
960 B
JavaScript
Raw Normal View History

2016-06-29 10:27:04 +00:00
var webpack = require('webpack')
var WebpackDevServer = require('webpack-dev-server')
var config = require('./webpack.dev')
2016-06-29 10:27:04 +00:00
const PORT = process.env.PORT || 3000
2016-06-29 10:27:04 +00:00
new WebpackDevServer(webpack(config), {
disableHostCheck: true,
2016-06-29 10:27:04 +00:00
publicPath: config.output.publicPath,
hot: true,
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
}
}).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
})