Skip to content

Commit

Permalink
Bundle analysis with Statoscope
Browse files Browse the repository at this point in the history
  • Loading branch information
plesiecki committed Mar 4, 2022
1 parent 9187458 commit 1404ce2
Show file tree
Hide file tree
Showing 4 changed files with 338 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
body: ':stopwatch: Lighthouse report: ' + process.env.REPORT_URL
})
- name: Copy bundle analysis report
run: cp build/report-*.html ./.lighthouseci

- uses: actions/upload-artifact@v2
with:
name: lighthouse-report
Expand Down
12 changes: 11 additions & 1 deletion config/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ const merge = require('webpack-merge');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const { default: StatoscopeWebpackPlugin } = require("@statoscope/webpack-plugin");

const bundleAnalyzerConfig = {
plugins: [
new StatoscopeWebpackPlugin({
open: false,
saveReportTo: "./build/report-[name].html",
}),
]
}

const prodConfig = {
name: "client-modern",
Expand Down Expand Up @@ -57,6 +67,6 @@ const es5Config = {
};

module.exports = [
merge.smart(commonConfig, prodConfig),
merge.smart(commonConfig, prodConfig, bundleAnalyzerConfig),
merge.smart(commonConfig, prodConfig, es5Config),
]
Loading

0 comments on commit 1404ce2

Please sign in to comment.