Answers for "webpack set mode"

1

webpack set mode to development

webpack --mode=development
Posted by: Guest on June-18-2021
1

webpack set development mode

//in webpack.config.js file add this
module.exports = {
  ....
  mode: 'development',
  ....
};
Posted by: Guest on July-22-2021
1

set env production webpack build

// webpack.config.js
module.exports = env => {
	const isProduction = env.NODE_ENV === 'production'
    // ...
    return {
      // ...
    }
}

// package.json
{
	...
    "scripts": {
    	"build": "webpack --env.NODE_ENV=production"
    },
    ...
}
Posted by: Guest on June-09-2020

Browse Popular Code Answers by Language