8000 Rollup warnings by hildjj · Pull Request #252 · peggyjs/peggy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 3 commits into from
May 27, 2022
Merged

Rollup warnings #252

merged 3 commits into from
May 27, 2022

Conversation

hildjj
Copy link
Contributor
@hildjj hildjj commented May 27, 2022

Fixes #220.

@hildjj
Copy link
Contributor Author
hildjj commented May 27, 2022

I'll rebase this once #248 lands.

@hildjj hildjj mentioned this pull request May 27, 2022
15 tasks
@hildjj hildjj force-pushed the rollup-warnings branch from 041016e to 8eeaee8 Compare May 27, 2022 16:24
},
},
external: ["chai"],
plugins : [
ignore(["fs", "os", "path", "tty", "url", "util"]),
json(),
Copy link
Member

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).

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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).

@hildjj hildjj merged commit 9a45172 into peggyjs:1.3 May 27, 2022
@hildjj hildjj deleted the rollup-warnings branch May 27, 2022 21:17
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

Successfully merging this pull request may close these issues.

2 participants
0