ionic-team / ionic-team/rollup-plugin-node-polyfills
existsSync is not exported
- Vorherrschende Sprache
- JavaScript
- Sterne
- 142
- Forks
- 65
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
With this configuration:
```node
import copy from "rollup-plugin-copy";
import sucrase from "@rollup/plugin-sucrase";
import json from "@rollup/plugin-json";
import css from "rollup-plugin-css-only";
import resolve from "@rollup/plugin-node-resolve";
import svg from "rollup-plugin-svg";
import nodePolyfills from 'rollup-plugin-node-polyfills';
export default {
input: "src/index.jsx",
output: {
file: "dist/index.js",
format: "iife",
globals: {
react: "React",
fs: "fs",
path: "path",
"react-dom": "ReactDOM",
},
},
//This is meant to suppress the warning for d3-selection circular dependencies (https://github.com/d3/d3-selection/issues/168)
onwarn: function (warning, warn) {
if (warning.code === "CIRCULAR_DEPENDENCY") return;
warn(warning);
},
plugins: [
svg(),
css({ output: "css/bundle.css" }),
json(),
nodePolyfills(),
sucrase({
transforms: ["jsx"],
production: true,
}),
copy({
targets: [
{
src: [
"node_modules/react/umd/react.development.js",
"node_modules/react-dom/umd/react-dom.development.js",
"src/static/*",
],
dest: "dist",
},
],
verbose: true,
}),
resolve(),
],
external: ["react", "react-dom"],
};
```
I get this error
```
[!] Error: 'existsSync' is not exported by node_modules/rollup-plugin-node-polyfills/polyfills/empty.js, imported by ../../core/utils/silly-i18n/src/index.js
```
It's true that the documentation mentions
> optional, add option to enable browserified shim
However, not clear how to add that option. What does it really mean?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start with the nodePolyfills() configuration and the polyfills/empty.js path named in the error, then inspect the existsSync import from ../../core/utils/silly-i18n/src/index.js. Done means identifying or documenting the option that supplies the browserified shim and confirming the Rollup build no longer reports existsSync as missing.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, node.js
- Bereich
- build-system, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100