mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-15 07:00:28 -08:00
feat: add stats.json to out, and prepare report
This commit is contained in:
parent
55f0b7b6fc
commit
7e615fe86c
2 changed files with 23 additions and 7 deletions
|
|
@ -12,13 +12,9 @@ const ThreadsPlugin = require('threads-plugin');
|
|||
const ExternalsPlugin = require('webpack5-externals-plugin');
|
||||
const EventHooksPlugin = require('event-hooks-webpack-plugin');
|
||||
const WebpackBar = require('webpackbar');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||
|
||||
const shared = [
|
||||
// this will generate 150M size of stats.json, and we have no way to ignore it (ignore option is not working for things inside `.webpack` folder)
|
||||
// process.env.NODE_ENV === 'production' ? new BundleAnalyzerPlugin({ generateStatsFile: true, analyzerMode: 'disabled' }) : undefined
|
||||
];
|
||||
|
||||
exports.main = _.compact([
|
||||
// we only need one instance of TsChecker, it will check main and renderer all together
|
||||
new ForkTsCheckerWebpackPlugin(),
|
||||
|
|
@ -49,7 +45,6 @@ exports.main = _.compact([
|
|||
plugins: ['ExternalsPlugin'],
|
||||
}),
|
||||
new WebpackBar(),
|
||||
...shared,
|
||||
]);
|
||||
|
||||
exports.renderer = [
|
||||
|
|
@ -73,5 +68,8 @@ exports.renderer = [
|
|||
},
|
||||
),
|
||||
new WebpackBar(),
|
||||
...shared,
|
||||
process.env.NODE_ENV === 'production'
|
||||
? // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
new BundleAnalyzerPlugin({ generateStatsFile: true, analyzerMode: 'disabled', statsFilename: '../../out/webpack-stats-renderer.json' })
|
||||
: undefined,
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue