Skip to content

yumo-mt/lazyload-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lazyload-loader

按照路由分割的方式实现懒加载

用法:

 npm install --save-dev lazyload-loader

webpack配置


 module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        use: [
          'babel-loader',
          'lazyload-loader',
        ]
      },
    ···
  },

Router 的配置

// 使用lazy! 作为前缀
import Shop from 'lazy!./view/Shop';

// Route 正常使用
 <Route path="/shop" component={Shop} />

License

The MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published