Skip to content

Parcel will duplicate modules across entry points #4890

Description

@jakearchibald

🐛 bug report

https://github.com/GoogleChromeLabs/tooling.report/tree/4159c1e7a96cd5052e86aeafc1ff214f556074a0/tests/output-module-formats/subtests/es-modules/parcel

In this example two entry points import a common module, and Parcel duplicates the module in each entry point, leading to out of sync state.

It seems like this was fixed in particular cases (#4302), but this example is a library (isLibrary is true), so there's no way to know if each entry point will be in its own realm or not.

I think the behaviour needs to change so Parcel only duplicates modules if it's sure that they stay in different realms, as in the entry points are HTML. Although, there may be cases where the developer still wants to opt out of this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions