When trying to upgrade to Webpack 5 from Webpack 4, I get the following error message:
Module.entryModule: Multiple entry modules are not supported by the deprecated API (Use the new ChunkGroup API)
I have tried to find documentation on ChunkGroup API but I can't seem to find anything. Do you know what the new way of having multiple entries is or how to use ChunkGroup API?
My module.exports looks as follows:
const config = {
entry: {
dev1: [
__dirname + "/js/tools/dev1/dev1.ts",
__dirname + "/css/tools/dev1.scss",
],
dev2: [__dirname + "/js/dev2.ts", __dirname + "/css/dev2.scss"],
],
},
output: {
path: path.resolve(__dirname, "../") + "/server/dist",
filename: "[name].js",
},
resolve: {
extensions: [".js", ".ts", ".tsx"],
},
// OMITTED FOR SIMPLICITY...
}
When trying to upgrade to Webpack 5 from Webpack 4, I get the following error message:
Module.entryModule: Multiple entry modules are not supported by the deprecated API (Use the new ChunkGroup API)
I have tried to find documentation on ChunkGroup API but I can't seem to find anything. Do you know what the new way of having multiple entries is or how to use ChunkGroup API?
My module.exports looks as follows:
const config = {
entry: {
dev1: [
__dirname + "/js/tools/dev1/dev1.ts",
__dirname + "/css/tools/dev1.scss",
],
dev2: [__dirname + "/js/dev2.ts", __dirname + "/css/dev2.scss"],
],
},
output: {
path: path.resolve(__dirname, "../") + "/server/dist",
filename: "[name].js",
},
resolve: {
extensions: [".js", ".ts", ".tsx"],
},
// OMITTED FOR SIMPLICITY...
}
Share
Improve this question
edited Dec 15, 2020 at 0:54
Eduardo Morales
asked Dec 12, 2020 at 23:02
Eduardo MoralesEduardo Morales
82311 silver badges32 bronze badges
2
-
Could it be the problem of using
.ts
along with.scss
in your entry points? Why don't you importscss
in thets
file respectively? Any specific benefits? – Sam Chen Commented Dec 13, 2020 at 1:52 - do you know what the ChunkGroup API is? – Eduardo Morales Commented Dec 14, 2020 at 19:14
1 Answer
Reset to default 20My issue was that I was using "webpack-fix-style-only-entries" but it is not patible with Webpack 5. Instead, I switched to webpack-remove-empty-scripts.
See: https://libraries.io/npm/webpack-remove-empty-scripts