您的位置:首页 > Web前端 > JavaScript

[Poi] Build and Analyze Your JavaScript Bundles with Poi

2018-01-03 21:10 621 查看
Ever wonder where those extra KB in your bundle are coming from? This lesson walks you through running Poi's build process. Then we'll add a bundle analyzer to find where you may be able to trim down on your file size.

Install:

npm i -D webpack-bundle-analyzer


Build project:

poi build


poi.config.js:

const BundleAnalyzer = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = (options) => ({
webpack(config) {

if(options.analyze) {
config.plugins.push(
new BundleAnalyzer()
)
}

return config;
}
})


Run with analyzer:

poi build --analyze
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐