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: normalize moduleName of absolute runtime #10242
fix: normalize moduleName of absolute runtime #10242
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11180/ |
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.
Would path.posix.dirname
work instead?
I don't know how to add a unit test given that CI runs on Linux only.
It's ok; in the future we should use Travis CI to test Babel on windows maybe.
cc @sag1v
Could you try cloning this branch and checking if it works? Neither me nor @JLHwung have Windows to test it.
@sag1v Could you test on your machine to see if the test is now fixed on this branch?
|
Oh I just assume everyone is cloning babel/babel, in this case you can add it as a new remote
Surely you can. Note that |
Thanks @JLHwung ! As for the tests, still failing.
And when i run
|
Interesting. It seems like I have replaced a bug with another one. I will investigate later.
This one is related to how sourcemap is generated. @sag1v Thank you for posting test results. I guess I had better get a Windows environment running and go through these issues. |
@nicolo-ribaudo My perspective on this PR has changed: Even if we may normalize the path separator in the import call, the transformed result injected with absolute path can only run on Windows -- we cannot get rid of the leading disk label anyway. As Windows build of Node.js support both The test failure is expected, as the behavior of injecting absolute path runtime, is os-dependent. @sag1v There are other issues, i.e. source maps that may need fix. The discussions above focus only on the |
I'm ok with closing it as "wontfix", but I'd really like to have an option to skip running a test on some platform. Something like this: {
"plugins": [ /* ... */ ],
"os": ["Linux"]
} Similar to
|
@nicolo-ribaudo Good idea. Let's discuss the |
The moduleName of resolved absolute runtime should be normalized, otherwise it will return
PATH\\TO\\MODULE
on Windows 7, which is apparently incorrect.I don't know how to add a unit test given that CI runs on Linux only.