You can add the plugins as suggested by @Vikramaditya.
Then to generate the production build. You have to run the the command
NODE_ENV=production webpack --config ./webpack.production.config.js
If using babel
, you will also need to prefix BABEL_ENV=node
to the above command.
More Related Contents:
- How to make the webpack dev server run on port 80 and on 0.0.0.0 to make it publicly accessible?
- React-router with BrowserRouter / browserHistory doesn’t work on refresh
- Error message “error:0308010C:digital envelope routines::unsupported”
- ‘npm start’ returns error: “There might be a problem with the project dependency tree”
- Angular 6 many Can’t resolve errors (crypto, fs, http, https, net, path, stream, tls, zlib)
- npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
- npx command not found
- Jest gives `Cannot find module` when importing components with absolute paths
- Get version number from package.json in React Redux (create-react-app)
- Webpack 4 “size exceeds the recommended limit (244 KiB)”
- How to organise file structure of backend and frontend in MERN
- How to fix “FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed – JavaScript heap out of memory” error
- Find the version of an installed npm package
- NPM Install Error:Unexpected end of JSON input while parsing near ‘…nt-webpack-plugin”:”0’
- Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’
- Using npm behind corporate proxy .pac
- npm WARN package.json: No repository field
- How to npm install to a specified directory?
- can you host a private repository for your organization to use with npm?
- Angular2 QuickStart npm start is not working correctly
- Node Sass couldn’t find a binding for your current environment
- How to consume npm modules from typescript?
- How to send email from my react web application
- Webpack output is empty object
- Webpack breaking change
- Browserify – How to call function bundled in a file generated through browserify in browser
- Can’t resolve ‘fs’ using webpack and react
- NPM – Can’t install socket.IO
- Cannot install bcrypt node.js module on Centos Server
- How to deploy reactapp with heroku-22?