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

Default "include" option fails for monorepos

Aperta
#17 3 commenti 3 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
142
Fork
65
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

[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`.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.