How to update webpack plugins with breaking changes from v4 to v5?

597 Views Asked by At

From webpack's official migration tutorial: https://webpack.js.org/migrate/5/

Update outdated options

Update the following options to their new version (if used):

enter image description here

Does it mean that those plugins will no longer exist as actual plugins?

What I mean:

webpack.config.js

const webpack = require("webpack");

const config = {
  plugins: [
    new webpack.NamedModulesPlugin(),
    // new webpack.HashedModuleIdsPlugin(),
    new webpack.NamedChunksPlugin(),
  ]
};

Should be converted to the following config?

const config = {
  optimization: {
    moduleIds: "named" | "deterministic",   // ONE OF THESE VALUES
    chunkIds: "named"
  }
};
0

There are 0 best solutions below