1.1.1 • Published 9 years ago
async-component-loader v1.1.1
async-component-loader
A Webpack loader that automatically creates code splitting points around components.
Getting Started
Prerequisities
- webpack
Installing
Install async-component-loader
as a development dependency
npm install --save-dev async-component-loader
Add the loader to you webpack config
// webpack.config.js
// ... your config here ...
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'async-component',
include: [path.resolve(__dirname, 'src/routes')]
}
]
}
It is a good idea to limit the loader to certain path that includes only React components that you want to have loaded lazily. Using this loader on everything will break things.
License
This project is licensed under the MIT License.
Acknowledgments
This project was inspired by the
bundle-loader
source and I looked
at the babel-loader
tests quite a
bit as well.