Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

existsSync is not exported #27

Open
JJ opened this issue Jun 7, 2021 · 0 comments
Open

existsSync is not exported #27

JJ opened this issue Jun 7, 2021 · 0 comments

Comments

@JJ
Copy link

JJ commented Jun 7, 2021

With this configuration:

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant