Open guybedford opened 7 years ago
What level of support for dynamic import is currently supported? (If any)
For example I noticed the following somewhat works
import * as x from "somemodule";
// whatever some code here
// followed by a dynamic import later in the file:
import("othermodule").then(x => { /* dosomething */ });
the othermodule is transpiled to _context.import("othermodule").then ...
however normalization of the module does not work. So it didn't became _content.import("npm:othermodule:0.0.0/lib.js").then...
Is any support for dynamic imports via System.import()
planned, or only ES6 import()
syntax?
Is there any support for dynamic imports via System.import() currently? In other words, when using the builder, in the final bundle am I supposed to see the modules that are dynamically imported?
Nope. Modules imported with System.import are not considered as dependencies of the script calling them.
Which is not necessarily bad specially if you import a huge library inside a función call.
I'm trying to build react router that works with systemjs and webpack together and I need a dynamic import to do so. does anyone know any solution for that? my router currently work with systemjs "System.import" to publishing it on npm I need to make it work with webpack too is there a way I can define systemjs as a dependency and import it in my module?
Support dynamic import syntax through the Babel compiler.
This should probably disable Rollup optimizations for that specific module as Rollup doesn't support dynamic imports.
Then this should also be added to the plugin ecosystem as well.