fix: build standalone on windows#14462
Conversation
|
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. |
| } | ||
|
|
||
| warning.importer = normalizePath(warning.importer); | ||
| warning.exporter = normalizePath(warning.exporter); |
There was a problem hiding this comment.
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.
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.
* 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>
Uh oh!
There was an error while loading. Please reload this page.