Skip to content

Instantly share code, notes, and snippets.

@Ranguro
Created October 29, 2018 17:56
Show Gist options
  • Save Ranguro/1e2fed220208078b38799bab3c8189f1 to your computer and use it in GitHub Desktop.
Save Ranguro/1e2fed220208078b38799bab3c8189f1 to your computer and use it in GitHub Desktop.
Webpack Config
const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.config.common.js');
const environment = 'development';
const envParams = require('./webpack.params').getEnv(environment);
module.exports = merge(common, {
devtool: 'source-map',
devServer: {
inline: true
},
entry: [
// 'eventsource-polyfill', // necessary for hot reloading with IE
'webpack-hot-middleware/client?reload=true', // note that it reloads the page if hot module reloading fails.
'./client/js/index'
],
output: {
filename: 'index.js'
},
watchOptions: {
aggregateTimeout: 10000,
poll: 5000
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
// new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin(envParams)
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment