-
Notifications
You must be signed in to change notification settings - Fork 116
import named doesn't work with re-exported contents #35
Comments
👍... big issue for my use case, as React's main file behaves exactly like this. |
That is difficult to do safely. Any reason not to use custom named exports? |
Because you can't always control the code in your dependencies. |
I believe I am seeing a similar error, and was referred here by This Issue From Rollup. I am building a React project with ES6 syntax and when I use a certain file from one of my dependencies(Material-UI), I get the following error in the console when I run the successfully built bundle:
Going to the referenced line, I see something strange:
MakeSelectable$1 is the undefined variable. Grepping through the file, all references of that particular variable are all in that last two lines, where it is called solely
And my
|
allow custom named exports to work with optimised modules
Apologies for the long silence, finally got a spare weekend to try and close out some old issues. There really isn't a good way to automatically re-export bindings, but the situation is basically no different from any other CommonJS module where named exports can't automatically be identified, and The config would need to look something like this: plugins: [
commonjs({
namedExports: {
'the-module/path/to/the-file.js': [ 'foo', 'bar', 'baz' ]
}
})
] @jeffbcross I can't exactly tell from the report, but I suspect your issue may have been fixed in recent versions. I'll be optimistic and close this but if not, do let us know. Thanks |
The text was updated successfully, but these errors were encountered: