-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set faceModuleId for manual chunks #3497
Comments
A facadeModuleId is not about the content of a chunk. Instead, it describes which module signature a chunk tries to replicate with its exports. A manualChunk does not try to replicate a module. As a matter of fact, it can be a conglomerate of dozens of modules and their dependencies. That’s why it does not make sense to add this to a manual chunk. On the other hand, you can see which modules are contained in a chunk by checking |
My use case is for plugins which transform code in the |
But if there is just not one module to define a manual chunk but many, it does not really help, does it? In the best case, you could get an array or a Set of ids. And we would need to add a new property for that. |
If you're defining a manual chunk you're already in control of what goes in, so ideally you'd be able to refer to these chunks by the name you gave it later on and tell plugins to exclude it. If they're not manual chunks I agree anything could be in there, so it's hard to filter on that. |
For manual chunks, the export default {
input: {
// created chunk will have name "my-name" and facadeModuleId "main.js"
'my-name': 'main.js',
// created chunk will have name "other-entry" and facadeModuleId "other.js"
'other-entry': 'other.js',
},
manualChunks: {
// created chunk will have name "my-name" and facadeModuleId null
'my-name': ['file-a.js', 'file-b.js'],
// created chunk will have name "manual" and facadeModuleId null
'manual': ['file-c.js']
},
...
} |
Name is perfect for this use case, I was testing this in the REPL and I just |
Feature Use Case
When performing logic on rendered chunks, it would be useful to be able to identify them. Using manual chunks we can place some code in a separate chunk, but we need a way to identify them.
Feature Proposal
faceModuleId can be used for regular chunks, it would be nice to be able to use this for manul chunks too.
See this reproduction where the faceModuleId is not set for the manual chunk: https://repl.it/repls/WigglySpiffyDatabase
The text was updated successfully, but these errors were encountered: