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

Does the usage of rollup-plugin-node-globals increase the size of the distributed module? #27

Open
kopax opened this issue Sep 29, 2019 · 0 comments

Comments

@kopax
Copy link

kopax commented Sep 29, 2019

I have written a node plugins, and I have the following error:

Error: 'existsSync' is not exported by node_modules/rollup-plugin-node-builtins/src/es6/empty.js
src/index.js → dist/@scope/docx2latex.min.js...
(!) Circular dependency: node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/duplex.js -> node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/readable.js -> node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/duplex.js
(!) Circular dependency: node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/duplex.js -> node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/writable.js -> node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/duplex.js
[!] Error: 'existsSync' is not exported by node_modules/rollup-plugin-node-builtins/src/es6/empty.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src/docx2latex/convert-docx2latex.js (2:9)
1: import execa from 'execa';
2: import { existsSync } from 'fs';
            ^
3: import { join } from 'path';
4: import logger from 'debug';
Error: 'existsSync' is not exported by node_modules/rollup-plugin-node-builtins/src/es6/empty.js
    at error (/home/dka/workspace/git.myprivate.com/myorg/docx2latex/node_modules/rollup/dist/rollup.js:10149:30)
    at Module.error (/home/dka/workspace/git.myprivate.com/myorg/docx2latex/node_modules/rollup/dist/rollup.js:14132:9)
    at handleMissingExport (/home/dka/workspace/git.myprivate.com/myorg/docx2latex/node_modules/rollup/dist/rollup.js:14051:21)
    at Module.traceVariable (/home/dka/workspace/git.myprivate.com/myorg/docx2latex/node_modules/rollup/dist/rollup.js:14443:17)
    at ModuleScope.findVariable (/home/dka/workspace/git.myprivate.com/myorg/docx2latex/node_modules/rollup/dist/rollup.js:13141:39)
    at FunctionScope.findVariable (/home/dka/workspace/git.myprivate.com/myorg/docx2latex/node_modules/rollup/dist/rollup.js:2981:38)
    at ChildScope.findVariable (/home/dka/workspace/git.myprivate.com/myorg/docx2latex/node_modules/rollup/dist/rollup.js:2981:38)
    at FunctionScope.findVariable (/home/dka/workspace/git.myprivate.com/myorg/docx2latex/node_modules/rollup/dist/rollup.js:2981:38)
    at ChildScope.findVariable (/home/dka/workspace/git.myprivate.com/myorg/docx2latex/node_modules/rollup/dist/rollup.js:2981:38)
    at FunctionScope.findVariable (/home/dka/workspace/git.myprivate.com/myorg/docx2latex/node_modules/rollup/dist/rollup.js:2981:38)

This is related versions in my package.json:

    "rollup-plugin-babel": "^4.3.2",
    "rollup-plugin-cleanup": "^3.1.1",
    "rollup-plugin-commonjs": "^9.3.4",
    "rollup-plugin-inject": "^2.2.0",
    "rollup-plugin-json": "^4.0.0",
    "rollup-plugin-node-builtins": "^2.1.2",
    "rollup-plugin-node-resolve": "^4.2.4",
    "rollup-plugin-replace": "^2.2.0",
    "rollup-plugin-terser": "^4.0.4",
    "rollup-plugin-visualizer": "^1.1.1",
    "rollup-watch": "^4.3.1"

I decided to use rollup-plugin-node-globals and now the error is gone,

So I wonder, can I use by default rollup-plugin-node-globals even in web project or it will increase the size of the distributed module?

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