Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Which is the latest version of webpack 4?


Asked by Elijah Spencer on Dec 14, 2021 FAQ



Webpack 5 requires at least Node.js 10.13.0 (LTS), so make sure you upgrade your Node.js if you're still running an older one. Upgrade webpack 4 and its plugins/loaders Upgrade webpack 4 to the latest available version. When using webpack >= 4, upgrading to the latest webpack 4 version should not require additional guidance.
Subsequently,
To install the latest release or a specific version, run one of the following commands: Whether to use --save-dev or not depends on your use cases. Say you're using webpack only for bundling, then it's suggested that you install it with --save-dev option since you're not going to include webpack in your production build.
Indeed, As webpack 5 removes all deprecated features, make sure there's no webpack deprecation warnings during the build in order to proceed. Set mode to either production or development to make sure that corresponding defaults are set. Update the following options to their new version (if used):
And,
Set it to 'production', 'development' or 'none' depending on your configuration type. The purpose of 'development' mode and 'production' mode is different. You can use webpack-merge as shown in production guide to optimize configurations. These plugins can be removed from configuration as they are default in production mode:
Keeping this in consideration,
If you are using other ES2015 features, make sure to use a transpiler such as Babel or Bublé via webpack's loader system. As of version 4, webpack doesn't require any configuration, but most projects will need a more complex setup, which is why webpack supports a configuration file.