Skip to content

Instantly share code, notes, and snippets.

@whilelucky
Last active September 15, 2017 01:10
Show Gist options
  • Save whilelucky/563e6bda38f4f5b6293ceb32f38c85a2 to your computer and use it in GitHub Desktop.
Save whilelucky/563e6bda38f4f5b6293ceb32f38c85a2 to your computer and use it in GitHub Desktop.
route-splitting
<Route
name="landing"
path="/"
getComponent={
(_, cb) => import('./views/LandingPage/LandingPage' /* webpackChunkName: 'landing' */)
.then((module) => cb(null, module.default))
.catch((error) => cb(error, null))
}
</Route>
//extract css from all the split chunks into main.hash.css
new ExtractTextPlugin({
filename: 'css/[name].[contenthash:8].css',
allChunks: true,
}),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment