Closed egorvoronov closed 6 years ago
Its babel transform, so its changing the syntax.
The beauty here is if use the lates of this repo. theres the default then and catch that youd find in a promise. If you arent up to date, that might cause you some issues. But ive extensively worked with this plugin and system. import() is import() all functions the same way
Yea, (0, _universalImport3.default)
internally insures you can use the promise returned from import()
as usual:
https://github.com/faceyspacey/babel-plugin-universal-import/blob/master/universalImport.js#L3-L18
I think there was a bug related to it I fixed 2 months ago. Let me know if you're still having problems using the promise regularly. Gonna close this out for now, but feel free to keep the thread going.
If anyone is looking at this issue, you must use Promises for babel-plugin-universal-import
not to interfere with dynamic imports like this, async/await
will not do.
Hi James,
thanks for this work, it's amazing!!
I'd like to clarify one moment here. What if I have not universal components but only some js that I would like also to lazy load. I'm doing this with usual:
and then like
and it looks like it tries to apply universal code here but it shouldn't, right?