We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yarn add -D speed-measure-webpack-plugin # OR npm install -D speed-measure-webpack-plugin
speed-measure-webpack-plugin | GitHub
react-app-rewired + customize-cra 方案
react-app-rewired
customize-cra
修改 config-overrides.js 文件
config-overrides.js
const { override } = require('customize-cra') const SpeedMeasurePlugin = require('speed-measure-webpack-plugin') const smp = new SpeedMeasurePlugin() const customWebpackConfig = (config) => smp.wrap(config) module.exports = override(customWebpackConfig)
修改 vue.config.js 文件
vue.config.js
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin') const smp = new SpeedMeasurePlugin() // 方案一 module.exports = { configureWebpack: (config) => { // 其他配置 smp.wrap(config) } } // 方案二 module.exports = { configureWebpack: smp.wrap({}) }
yarn add -D webpack-bundle-analyzer # OR npm install -D webpack-bundle-analyzer
webpack-bundle-analyzer | GitHub
const { override, addBundleVisualizer } = require('customize-cra') module.exports = override(addBundleVisualizer)
create-react-app 官方推荐使用 source-map-explorer
create-react-app
source-map-explorer
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin module.exports = { chainWebpack(config) { config.plugin('webpack-bundle-analyzer').use(BundleAnalyzerPlugin) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Webpack 性能分析
打包速度分析 speed-measure-webpack-plugin
yarn add -D speed-measure-webpack-plugin # OR npm install -D speed-measure-webpack-plugin
speed-measure-webpack-plugin | GitHub
create-react-app
react-app-rewired
+customize-cra
方案修改
config-overrides.js
文件vue-cli 4.x
修改
vue.config.js
文件打包体积分析 webpack-bundle-analyzer
yarn add -D webpack-bundle-analyzer # OR npm install -D webpack-bundle-analyzer
webpack-bundle-analyzer | GitHub
create-react-app
react-app-rewired
+customize-cra
方案修改
config-overrides.js
文件create-react-app
官方推荐使用source-map-explorer
vue-cli 4.x
修改
vue.config.js
文件The text was updated successfully, but these errors were encountered: