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
fix: build standalone on windows #14462
fix: build standalone on windows #14462
Conversation
liuxingbaoyu
commented
Apr 13, 2022
•
edited by gitpod-io
bot
edited by gitpod-io
bot
Q | A |
---|---|
Fixed Issues? | Fixes #14331 |
Patch: Bug Fix? | √ |
Major: Breaking Change? | × |
Minor: New Feature? | × |
Tests Added + Pass? | × |
Documentation PR Link | |
Any Dependency Changes? | |
License | MIT |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/51672/ |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/51668/ |
This is a crude solution. If you need to be robust enough, you may need to add new npm packages. |
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.
Thanks!
Gulpfile.mjs
Outdated
} | ||
|
||
warning.importer = normalizePath(warning.importer); | ||
warning.exporter = normalizePath(warning.exporter); |
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.
Since warning
is a Rollup object that we pass back to rollup, I'd prefer if we could avoid modifying it.
Instead, we can create an osifyPath = str => str.split("/").join(path.sep)
function and do warning.exporter === osifyPath("packages/babel-core/src/index.ts")
below ("osify" = "make it like the os").
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.
That's right! We should not modify this object.
The requested change has been completed.
But it looks a bit odd that "@babel/helper-define-polyfill-provider" -> "@babel\helper-define-polyfill-provider"
And this is a little inconvenient, we need to copy and paste osifyPath
when adding new conditions.
Maybe we can deep clone the warning
object, which is a small object.
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.
This looks fine!
* Update Rollup to `^2.60.1` (it generates an invalid bundle) * Update `@rollup/plugin-commonjs` * `@rollup/plugin-commonjs@22.0.0-0` * Update other @rollup/ packages * Replace `rollup-plugin-node-polyfills` with maintained fork * update rollup plugins * update rollup to 2.63.0 * remove dynamic require entrypoint * Update * Update rollup packages * Revert #14462 (Rolluo always normalizes paths now) * Update `rollup-plugin-polyfill-node` * Avoid `require` to files external to the bundle https://github.com/rollup/plugins/tree/master/packages/commonjs#ignoredynamicrequires= * Update `rollup-plugin-dts` Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>