ionic-team / ionic-team/rollup-plugin-node-polyfills

Default "include" option fails for monorepos

Open
#17 3 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
142
Forks
65
PR merge metrics
No merged PRs in 30d

Description

[heavily edited to match what the source of the bug is]

The default `include` option that’s passed to `rollup-plugin-inject`, `'node_modules/**/*.js'`, causes problems when working in a monorepo where `node_modules` dependencies are hoisted above the current working directory where `rollup` is run.

The `include` ends up getting resolved relative to the current directory, even though the Node resolution might find modules in a `node_modules` directory in a parent.

For me, this manifested in the `buffer-es6.js`’s `global` not getting converted into its own polyfill, which caused an `Uncaught ReferenceError: global is not defined` error.

A workaround is to manually specify an `include` option to the `rollup-plugin-node-polyfills`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.