0

I have quite a lot of experience with ES6 and imports, but I usually don't do imports and exports this way. I'm trying to understand what I'm overlooking here. I've done a lot of searching here, but no answers so far.

Exporting my function from File A export default myNamedExport;

Exporting my imported function in File B export myNamedExport from './FileA'; export someOtherNamedExport from './someFile';

Importing from File B into File C import { myNamedExport } from './FileB';

But when I do this my import looks like this:
myNamedExport: { myNamedExport, someOtherNamedExport }

I've tried this in at least 15 different configurations of various imports and exports including using default and as, but the outcome is always the same.

I would like to avoid importing everything and then re-exporting it in a default object, but what gives? Why is every configuration I use resulting in my function being within an object? Thanks for any ideas.

Slbox
  • 10,957
  • 15
  • 54
  • 106
  • There's nothing obviously wrong with the code as posted, so there are likely other factors at play. Would you be able to post the actual compiled UMD code for each module? – loganfsmyth Jun 27 '18 at 22:34
  • Also, does the issue go away if you strip things down even more and stop loading `someFile`? – loganfsmyth Jun 27 '18 at 22:34
  • You know what, this code seems to work fine upon further testing, but it appears completely wrong in the debugger. The actual behavior of this code is as intended, but in the debugger it appears as still an object full of functions? I'm not really sure what to make of that. – Slbox Jun 28 '18 at 19:19
  • What are you actually using to make your UMD? What were you doing in the debugger to see what you saw? There isn't really enough to go on right now. – loganfsmyth Jun 28 '18 at 20:17

0 Answers0