Replies: 3 comments 5 replies
-
First, I strongly don't recommend doing this. You really lose a lot of optimizations and do very bad things for your users, if you really want to development different scopes in your projects, please consider https://webpack.js.org/concepts/module-federation/
What do you mean? Look at There are more options here when webpack consider there place modules https://webpack.js.org/plugins/split-chunks-plugin/, look at |
Beta Was this translation helpful? Give feedback.
-
@romanlex Have you tried to use function as a
I've tried this config on simple test project, seems it works as you need: |
Beta Was this translation helpful? Give feedback.
-
Hi, did you come up with a solution? I'm trying to learn webpack, and this seems to me that it should be a very common behaviour, although I think your initial question is missing a vendor.js for common libs for the entire website. i.e. entryA.js + vendor.entryA.js + vendor.js
|
Beta Was this translation helpful? Give feedback.
-
I'm trying to set up splitting chunks based on entry point.
I want to get multiple files:
entryA.js
+vendor.entryA.js
entryB.js
+vendor.entryB.js
entryC.js
+vendor.entryC.js
entryD.js
+vendor.entryD.js
For this I use multiple cacheGroups in my webpack config
with
recursiveIssuer
It doesn't work properly because:
[contenthash]
each build or project for many filesentryB
randomly can usevendor.entryA.js
andvendor.entryD.js
"webpack": "5.74.0"
I don't known maybe it's a bug.
Beta Was this translation helpful? Give feedback.
All reactions