plugin-terser does not share nameCache between minify invocations when chunking across multiple entrypoint and common files
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- tooling
Research direction
Start with the linked StackBlitz reproduction and inspect plugin-terser's minify invocations, focusing on how nameCache is handled across chunks and entrypoints. Confirm the issue by comparing the mangled Foo._bar() names in dist/common.js and dist/entry2.js; done means the shared nameCache produces matching property names.
Written by the indexing model from the issue text.
Description
- Rollup Plugin Name: plugin-terser
- Rollup Plugin Version: 0.4.4
- Rollup Version: 4.59.0
- Operating System (or Browser): na
- Node Version: na
- Link to reproduction (⚠️ read below): https://stackblitz.com/edit/rollup-repro-hso9gj6r
Expected Behavior
plugin-terser shares the nameCache between minify invocations when rollup is configured to create multiple entry files and common files.
Actual Behavior
plugin-terser does not share the nameCache when rollup is configured to create multiple entry files and common files, this results in property mangling where names do not match between chunks.
Additional Information
In the linked reproduction observe that
- in file
dist/common.jsthe methodFoo._bar()is renamed to.o(). - in file
dist/entry2.jsthe methodFoo._bar()is renamed to.m().
If you inspect the execution of the terser plugin, it is observed that the nameCache is not shared between invocations of minify. This is true even for maxWorkers: 1.
- Dominant language
- JavaScript
- Stars
- 3.8k
- Forks
- 635
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rollup/plugins
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Support js-yaml v5 Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·