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
Use unescaped import specifier #1387
Use unescaped import specifier #1387
Conversation
|
Hello @LarsDenBakker, I am sorry for the mention :( Could you please review this PR? It fixes a bug with the import of the commonjs helper. Thank you! |
This is interesting.. but in the |
The problem occurs when using both esbuild and commonjs plugins. I think that esbuild output "reverts" the null character transformation 🤔 |
I'm not sure that's the case, we transform the import to a whole different import. Do you see that this change fixes a specific problem? What I saw in the past was that the null character would be sent to the browser but not sent back in the request URL.. making it useless. |
I'll try to setup a unit test for reproduction. |
ed3126d
to
a971dbe
Compare
Hello @LarsDenBakker, I added an unit test with the use case. If you revert the proposed fix, you can see that null character is not handled after esbuild transformation. |
Thanks, should be good to go then. |
Since version 0.4.0,
es-module-lexer
exposes an
property for each import specifier with its unescaped source. This is useful (and more accurate) for virtual modules like\0commonHelpers
.What I did
n
property of the specifier, fallback to the previous version if missing.