-
Notifications
You must be signed in to change notification settings - Fork 69
Rollup warnings #252
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
Rollup warnings #252
Conversation
I'll rebase this once #248 lands. |
}, | ||
}, | ||
external: ["chai"], | ||
plugins : [ | ||
ignore(["fs", "os", "path", "tty", "url", "util"]), | ||
json(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just using
globals: {
// ...
tty: "ignore_tty",
url: "ignore_url",
util: "ignore_util",
},
does not work?
Have you found the reason of those warnings? It seems that these modules used only by CLI, but CLI shouldn't be bundled in browser bundle, isn't it? (I've tried to search in the peggy source tree usages of "fs"
, "os"
, "path"
, "tty"
, "url"
, "util"
and all these strings are used only in tests or CLI or not used at all in the peggy code. The bundled code itself should have no any runtime dependencies, so it is unclear why those warnings is generated in the first place).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ignore_
approach almost works, but it leaves this warning still:
{
code: 'MISSING_NODE_BUILTINS',
message: 'Creating a browser bundle that depends on Node.js built-in modules ("util", "os", "tty", "url" and "path"). You might need to include https://github.com/snowpackjs/rollup-plugin-polyfill-node',
modules: [ 'util', 'os', 'tty', 'url', 'path' ],
toString: [Function (anonymous)]
}
The warnings that Rollup produces are inadequate to easily track where those modules are being used, but they are probably down in sinon
or something. Sinon also has a circular dependency in it, so I've created #253 to see if we can remove it one day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os
and tty
at least come from supports-color
, which sinon
includes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah... I see that these modules are used in browser_test_config
. Well, maybe they are really not used, at least tests in development/test.html
pass (the referred file docs/js/test-bundle.min.js
is a minified version of build/rollup/test.umd.js
, which is generated using browser_test_config
).
Fixes #220.