Skip to content

demos-platform/babel-plugin-on-demand-loading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version LICENSE MIT

diana 配套按需加载 babel 插件,更新日志

Usage

npm install --save-dev babel-plugin-on-demand-loading

使用方式一:在 .babelrc 里进行配置(推荐):

// .babelrc
{
  "plugins": [
    ["on-demand-loading", {"library": "diana"}]
  ]
}

// 配合 webpack 里的 babel-loader
module: {
  rules: [{
    test: /\.js$/,
    loader: "babel-loader",
  }]
},

使用方式二:在 webpack 里进行配置:

module: {
  rules: [{
    test: /\.js$/,
    loader: "babel-loader",
+   options: {
+     plugins: [
+       ["on-demand-loading", { "library": "diana" }],
+     ]
+   }
  }]
},

按需加载实践

About

diana 按需加载插件

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published