Add webpack analyzer, PR comments for webpack bundle size (#3383)
try that again 9 try that again 8 try that again 7 try that again 6 try that again 5 try that again 4 try that again 3 try that again 2 try that again merge base 3 merge base 2 merge base use latest main commit rather than tag webpack diff analyzer use cache v4 use cache again... blegh blegh try cache again cache try again one more adjutment adjust okay again maybe maybe now? maybe now oops again oops add diff comments add open analyzer script add webpack analyzer
This commit is contained in:
parent
9d9c9095ee
commit
b1bd7ab6e3
5 changed files with 210 additions and 9 deletions
|
@ -1,6 +1,10 @@
|
|||
const createExpoWebpackConfigAsync = require('@expo/webpack-config')
|
||||
const {withAlias} = require('@expo/webpack-config/addons')
|
||||
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
|
||||
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer')
|
||||
|
||||
const GENERATE_STATS = process.env.EXPO_PUBLIC_GENERATE_STATS === '1'
|
||||
const OPEN_ANALYZER = process.env.EXPO_PUBLIC_OPEN_ANALYZER === '1'
|
||||
|
||||
const reactNativeWebWebviewConfiguration = {
|
||||
test: /postMock.html$/,
|
||||
|
@ -26,5 +30,17 @@ module.exports = async function (env, argv) {
|
|||
if (env.mode === 'development') {
|
||||
config.plugins.push(new ReactRefreshWebpackPlugin())
|
||||
}
|
||||
|
||||
if (GENERATE_STATS || OPEN_ANALYZER) {
|
||||
config.plugins.push(
|
||||
new BundleAnalyzerPlugin({
|
||||
openAnalyzer: OPEN_ANALYZER,
|
||||
generateStatsFile: true,
|
||||
statsFilename: '../stats.json',
|
||||
analyzerMode: OPEN_ANALYZER ? 'server' : 'json',
|
||||
defaultSizes: 'parsed',
|
||||
}),
|
||||
)
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue