Skip to content

Instantly share code, notes, and snippets.

@lakshyaranganath
Last active Sep 15, 2017
Embed
What would you like to do?
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