Skip to content
New issue

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

Build: Use Statoscope webpack plugin for analysis #87645

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"start": "NODE_ENV=dev nx exec -- webpack --config scripts/webpack/webpack.dev.js --watch",
"start:noTsCheck": "yarn start -- --env noTsCheck=1",
"start:noLint": "yarn start -- --env noTsCheck=1 --env noLint=1",
"stats": "webpack --mode production --config scripts/webpack/webpack.prod.js --profile --json > compilation-stats.json",
"stats": "NODE_ENV=production webpack --progress --config scripts/webpack/webpack.stats.js",
"storybook": "yarn workspace @grafana/ui storybook --ci",
"storybook:build": "yarn workspace @grafana/ui storybook:build",
"themes-generate": "esbuild --target=es6 ./scripts/cli/generateSassVariableFiles.ts --bundle --platform=node --tsconfig=./scripts/cli/tsconfig.json | node",
Expand Down Expand Up @@ -88,6 +88,7 @@
"@react-types/shared": "3.23.0",
"@rtk-query/codegen-openapi": "^1.2.0",
"@rtsao/plugin-proposal-class-properties": "7.0.1-patch.1",
"@statoscope/webpack-plugin": "^5.28.2",
"@swc/core": "1.4.2",
"@swc/helpers": "0.5.11",
"@testing-library/dom": "10.0.0",
Expand Down
12 changes: 12 additions & 0 deletions scripts/webpack/webpack.stats.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

const StatoscopeWebpackPlugin = require('@statoscope/webpack-plugin').default;
const { merge } = require('webpack-merge');

const prodConfig = require('./webpack.prod.js');

module.exports = (env = {}) => {
return merge(prodConfig(env), {
plugins: [new StatoscopeWebpackPlugin()],
});
};