mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 02:06:29 -05:00
23972ffb16
* Add webpack-bundle-analyzer as dev-tool * Add README information about bundle analysis
22 lines
641 B
JavaScript
22 lines
641 B
JavaScript
const CopyPlugin = require('copy-webpack-plugin');
|
|
const { when } = require('@craco/craco');
|
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
|
|
module.exports = {
|
|
webpack: {
|
|
plugins: [
|
|
new CopyPlugin({
|
|
patterns: [
|
|
{ from: 'node_modules/@hpcc-js/wasm/dist/graphvizlib.wasm', to: 'static/js' },
|
|
{ from: 'node_modules/@hpcc-js/wasm/dist/expatlib.wasm', to: 'static/js' }
|
|
],
|
|
}),
|
|
...when(Boolean(process.env.ANALYZE), () => [
|
|
new BundleAnalyzerPlugin({
|
|
analyzerMode: "static",
|
|
generateStatsFile: true
|
|
})
|
|
], [])
|
|
],
|
|
},
|
|
}
|