danielstern / danielstern/isomorphic-react

Fix/Change - HMR & node_ENV++: webpack.config.dev.babel.js

Open
#68 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
375
Forks
253
PR merge metrics
No merged PRs in 30d

Description

#1: webpack.config.dev.babel.js

module.exports = {
/**
* The scripts in entry are combined in order to create our bundle
*/
mode: 'development',
entry: [
'webpack-hot-middleware/client?reload=true',
'babel-regenerator-runtime',
path.resolve(__dirname, 'src')
],
output: {
path: path.resolve(__dirname, 'public'),
filename: 'bundle.js',
publicPath: '/'
},

.....

##2: webpack.config.dev.babel.js

plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development'),
WEBPACK: true
}
}),

--------

###3: package.json/terminal install

npm install terser-webpack-plugin@^4 --save-dev
npm i webpack@^4 uglifyjs-webpack-plugin@^2

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.