Skip to content
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

Feature request: facadeModuleId in metafile outputs #711

Closed
yyx990803 opened this issue Jan 26, 2021 · 1 comment · Fixed by #811
Closed

Feature request: facadeModuleId in metafile outputs #711

yyx990803 opened this issue Jan 26, 2021 · 1 comment · Fixed by #811

Comments

@yyx990803
Copy link
Contributor

yyx990803 commented Jan 26, 2021

When building a multi-entry bundle with splitting: true, it is often necessary to map output chunks to their original entry modules. Currently, the metafile doesn't provide enough information to do this 100% accurately because two output chunks may contain the same inputs module (if entry B transitively imports entry A). What I am doing right now is checking which output chunk has the same ending sub path segments with the input modules, but this can potentially yield false positives if the paths happen to collide.

Rollup entry chunks contains a facadeModuleId property which points to the original entry module that this chunk was created from. It would be nice to have something similar in esbuild's metafile outputs.

@yyx990803
Copy link
Contributor Author

FYI for anyone else having similar needs: I've found a way to work around this by using custom entry point names, then using a plugin to resolve and load the entry points in a separate namespace. This keeps the name of the entry points (instead of the file system paths) so esbuild will generate a flat output structure with controlled filenames instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant