Skip to content

"module" being browser-specific breaks bundling with Parcel for node #35

@Andarist

Description

@Andarist

I know that this has somewhat been discussed in:

But the issue I'm facing is slightly different so I've decided to open a fresh one.

I understand why the current setup looks like it does and I can sympathize with you having to deal with that kind of issue as the current landscape of doing right by different tools is a mess (I also know this from experience 😉 ).

The problem is that assuming that "module" should contain only browser-specific code is a little bit of a stretch. Yes, it is primarily understood by bundlers which are used for building web apps most of the time but bundling for the node as a target is also a use case for them and historically no such limitation has been imposed on the files distributed as "module". It got introduced only to support a different authoring format, not the target platform.

I know you are supporting "browser" field and I would encourage you to put browser-specific code only there, otherwise people bundling this for node with Parcel or webpack will get broken builds.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions