Package Exports
- lazyload-loader
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lazyload-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
lazyload-loader
按照路由分割的方式实现懒加载
用法:
webpack配置
const lazyLoader = require('lazyload-loader')
module: {
rules: [
{
test: /\.(js|jsx)$/,
use: [
'babel-loader',
'lazyLoader',
]
},
···
},
Router 的配置
// 使用lazy! 作为前缀
import Shop from 'lazy!./view/Shop';