Skip to content

Package exports mean node version is always used with Webpack 5 #145

Closed
@gjvoosten

Description

@gjvoosten

Describe the bug

The current package.json specifies: https://github.com/JSONPath-Plus/JSONPath/blob/v5.0.2/package.json#L7-L10
which, if I read https://webpack.js.org/guides/package-exports/ correctly, mean the node version is always imported, even in browser mode.

We noticed this change in behaviour when our JSONPath queries were suddenly taking much longer to run after upgrading from v4.0.0 to v5.0.2. A query that would take < 3ms under v4.0.0 was suddenly taking > 100ms under v5.0.2. Replacing index-node-esm.mjs with index-browser-esm.js would bring the performance back to normal.

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