Closed
Description
Premise
System.import() allows webpack
to define split points for code splitting using es6 modules. It is a replacement for require.ensure()
Findings
- Multiple dependencies cannot be imported using
System.import()
alone. We need toPromise.all[System.import(), System.import()]
. But as per System.load support? webpack#3141, that does not work as expected as well. - Named chunks are not possible using
System.import()
.require.ensure()
has a parameter that allows us to name the chunks, hence separating or combining code from other split points in the application. This does not seem to be available withSystem.import()
Ask
System.import()
does not seem to be a perfect replacement and seems to create more problems. Are there workarounds for these issues?