来自 webpack 的官方迁移教程:https ://webpack.js.org/migrate/5/
更新过时的选项
将以下选项更新为新版本(如果使用):
这是否意味着这些插件将不再作为实际插件存在?
我的意思是说:
webpack.config.js
const webpack = require("webpack");
const config = {
plugins: [
new webpack.NamedModulesPlugin(),
// new webpack.HashedModuleIdsPlugin(),
new webpack.NamedChunksPlugin(),
]
};
应该转换成下面的配置吗?
const config = {
optimization: {
moduleIds: "named" | "deterministic", // ONE OF THESE VALUES
chunkIds: "named"
}
};