Skip to content

plugin-terser does not share nameCache between minify invocations when chunking across multiple entrypoint and common files #1970

@MarkDuckworth

Description

@MarkDuckworth

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.js the method Foo._bar() is renamed to .o().
  • in file dist/entry2.js the method Foo._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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions