-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Umd globals not working ? #6697
Comments
I can see that the functionality is not implemented here:
And i can create a PR for this. I have some inquiries about how it should be implemented:
Exact match ? And for
What is the expected src format ? => Absolute, relative, any of the two ? |
The format depends on the input. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Describe the bug
globals
in themodule
option oftype: umd
is there to remap the module name asigned toglobal
. That's how it is used in babel @babel/plugin-transform-modules-umdexposing
global.Promise
rather than the defaultglobal.es6Promise
.swc seeming to go with
global.fileName
. Which normally a config like:Should replace the
global.index
withglobal.HeroJs
for anindex.js
module file. That's not happening:The output still went as:
Full output file:
Input code
Config
Playground link
https://play.swc.rs/?version=1.3.23&code=H4sIAAAAAAAAA52S3WqEMBCF732KqVdZWITN7dIrKfQB9n4JIa5SycgYuy2L796JSST2vxUxP%2BckZz6TZrLadWjhrHs1jrXq%2B7o1%2Bkl0dnTKarOHGrlLk3ZIO7gVwE%2FXgLhbLZA62GzMye0f1xJewZornF4H80CEJMpaWYsONIeCgqUAUPxCE6sqd8dlh7mYi2dFUHvLAe5Xg0gZ5TQa4OROuzKsSZa4SOTVvId1bTfuo3GN9F8feh4IHXJo0Ktl6JgiGINcXTArCy64ySPjJrJwiFuHJk6GXY%2FFLDh5hZT%2FgZS%2FhZQ%2FQMovIPmYyeWcy8TfUGWG%2Bmho89v8%2BBvaz4n8osjjJyrtL4i%2Faengc03mmvQal2heBmSuW7pffAdj74MoV1FuxIWEpaVl4Q2cY2xrWAMAAA%3D%3D&config=H4sIAAAAAAAAA0WNTQoDIQxG75K1227mBKXQQ1gnM1j8I1GoiHdvMli6Svi%2Bl5cBb3awDSiWGEk37qnaD2yALlp25EsFI5hEhw2M00C1dGJVhG%2FShZwZV2sg%2BuSPriaXYyFk%2Flc2neFHThHFvDcNBtReZEKLuwjPkF%2BCaO5TafrpjpQfDNfRerCknp%2FLUqnh%2FAIpHc%2BU0gAAAA%3D%3D
Expected behavior
globs to work like with babel and allow renaming (mapping).
Actual behavior
globals not working.
Version
"@swc/cli": "^0.1.57", "@swc/core": "^1.3.23"
Additional context
No response
The text was updated successfully, but these errors were encountered: