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

existsSync is not exported

Abierto
#27 2 comentarios 2 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
142
Forks
65
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, node.js
Área
build-system, tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.