Lets load a react component and it’s dependencies. Make sure you’re using Webpack 2.0+ or none of this will work.
First we will create a component called
LoadComponent that will be responsible for… loading the component.
Two interesting things are happening:
1) We’re using
... read the whole story at mackness.github.io.
System.import which tells Webpack to create a separate bundle for the component we’re importing and it’s dependencies. At this point we have our primary code bundle and a separate bundle for the imported module and it’s dependencies (code splitting). If you clicked on the link you probably noticed
System.import got updated to simply