Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dealmakerai opened this issue Nov 10, 2021 · 0 comments
Open

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

dealmakerai opened this issue Nov 10, 2021 · 0 comments

Comments

@dealmakerai
Copy link

#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

@dealmakerai dealmakerai changed the title Fixes/Change for HMR & node_ENV++: webpack.config.dev.babel.js Fix/Change - HMR & node_ENV++: webpack.config.dev.babel.js Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant