Skip to content

fix: build standalone on windows#14462

Merged
nicolo-ribaudo merged 2 commits intobabel:mainfrom
liuxingbaoyu:fix-build-standalone-on-windows
Apr 14, 2022
Merged

fix: build standalone on windows#14462
nicolo-ribaudo merged 2 commits intobabel:mainfrom
liuxingbaoyu:fix-build-standalone-on-windows

Conversation

@liuxingbaoyu
Copy link
Copy Markdown
Member

@liuxingbaoyu liuxingbaoyu commented Apr 13, 2022

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

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Apr 13, 2022

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/51672/

@babel-bot
Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/51668/

@liuxingbaoyu
Copy link
Copy Markdown
Member Author

This is a crude solution.

If you need to be robust enough, you may need to add new npm packages.

Copy link
Copy Markdown
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JLHwung JLHwung added PR: Internal 🏠 A type of pull request used for our changelog categories os: windows labels Apr 13, 2022
Comment thread Gulpfile.mjs Outdated
}

warning.importer = normalizePath(warning.importer);
warning.exporter = normalizePath(warning.exporter);
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

@liuxingbaoyu liuxingbaoyu Apr 14, 2022

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.

Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine!

@nicolo-ribaudo nicolo-ribaudo merged commit e71843a into babel:main Apr 14, 2022
nicolo-ribaudo added a commit to nicolo-ribaudo/babel that referenced this pull request Apr 24, 2022
nicolo-ribaudo added a commit that referenced this pull request Apr 24, 2022
* 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>
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 15, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

os: windows outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: clone repo and error while make bootstrap

4 participants