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

Unexpected naming of chunks after manualChunks function #3973

Closed
oatymart opened this issue Feb 25, 2021 · 2 comments · Fixed by #4040
Closed

Unexpected naming of chunks after manualChunks function #3973

oatymart opened this issue Feb 25, 2021 · 2 comments · Fixed by #4040

Comments

@oatymart
Copy link

  • Rollup Version: 2.38.5
  • Operating System (or Browser): OSX 10.15.6
  • Node Version (if applicable): 10.23.0
  • Link to reproduction: https://repl.it/@oatymart/rollup-repro (REPL is slightly contrived, since I wouldn't normally use switch in manualChunks or mix and match chunk sizes. However I discovered the inconsistency while investigating why my single-module chunks would never take their specified names.)

Description

Given a manualChunks function for code-splitting based on language files, similar to that from the documentation (https://rollupjs.org/guide/en/#outputmanualchunks).
The resulting chunk naming is inconsistent.

Expected Behavior

Any chunk created by a manualChunks return value should have a name matching the string returned.

Actual Behavior

Chunks containing multiple modules take the name string returned from manualChunks function.
Chunks containing only 1 module take a name derived from the module filename.

@akauppi
Copy link

akauppi commented Apr 10, 2021

My project's also affected. It's not a huge turn-off but would definitely reduce the feeling of overwhelmedness often associated with packaging.

@lukastaegert
Copy link
Member

This is happening if there is a single dynamic entry point (i.e. target of a dynamic import(...)) in the chunk.
The issue was caused by a conflict with the name derived from the dynamic entry point with the manual chunk name. #4040 will switch the naming priorities here to avoid this and prefer the manual chunk name.

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.

3 participants