You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an library use babel 7 and @babel/plugin-transform-modules-umd to transform ES6 Modules into UMD.
And now i want to use this library to remove the ugly use of default.
I use babel-plugin-add-module-exports v1.0.2 in my project.
But the output code ended with
Just ran into this as well. After looking into it for a bit I decided to drop my dependency on this plugin and implement a separate solution; this plugin isn't really suited or aimed at use in combination with UMD or the browser.
I wrote my own Babel transform which works together with the UMD transform plugin to achieve the same effect as this plugin does with the addDefaultProperty setting enabled. See my babel.config.js file. Note it contains one additional feature specific for my use case on line 50, namely adding a secondary titlecased export when loaded in the browser. You may want to remove that second assignment.
While this solution is rather specialized, perhaps it might prove useful for others with similar use cases.
I have an library use babel 7 and
@babel/plugin-transform-modules-umd
to transform ES6 Modules into UMD.And now i want to use this library to remove the ugly use of
default
.I use
babel-plugin-add-module-exports
v1.0.2 in my project.But the output code ended with
When the output code running in browser, this Error comes out
I found a closed issue don't handle an amd module #57 here.
It seems i have the same issue in version 1.0.2
How can i solve this problem ? Thanks.
The text was updated successfully, but these errors were encountered: