Neolithic Prancing Minotaurs
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

async-component-loader

1.1.1 • Public • Published

async-component-loader

Build Status

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.

Install

npm i async-component-loader

DownloadsWeekly Downloads

0

Version

1.1.1

License

MIT

Last publish

Collaborators

  • avatar