Skip to content

How do I async load a component with AsyncRoute

PatrickJS edited this page Feb 1, 2016 · 2 revisions

The component must have .async.ts and require using webpack

{ path: '/about', loader: () => require('./about/about')('About') }

the .async.ts will let webpack know that the file should return a function that returns a promise. The function takes a namespace for the component. Also see es6-promise-loader

Clone this wiki locally