Skip to content

Commit 517db8e

Browse files
committed
Add rollup visualizer and update build stats config
1 parent e7b6498 commit 517db8e

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"eslint-plugin-react-19-upgrade": "^1.7.0",
6060
"eslint-plugin-react-hooks": "^7.0.0",
6161
"prettier": "^3.6.2",
62+
"rollup-plugin-visualizer": "^5.12.0",
6263
"sass": "^1.93.2",
6364
"stylelint": "^16.25.0",
6465
"stylelint-config-standard-scss": "^16.0.0",

relativeci.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
key: process.env.RELATIVE_CI_KEY,
33
upload: {
4-
buildStaticAssetsSizeWebpack: 'build/index.html',
4+
buildStaticAssetsSizeWebpack: './build/stats.json',
55
},
66
};

vite.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { defineConfig } from 'vite';
22
import react from '@vitejs/plugin-react';
33
import svgr from 'vite-plugin-svgr';
44
import path from 'path';
5+
import { visualizer } from 'rollup-plugin-visualizer';
6+
import fs from 'fs';
57

68
export default defineConfig(({ mode }) => ({
79
base: './',
@@ -70,6 +72,13 @@ export default defineConfig(({ mode }) => ({
7072
assetsDir: '',
7173
sourcemap: mode === 'development' ? 'inline' : true,
7274
rollupOptions: {
75+
plugins: [
76+
visualizer({
77+
filename: './build/stats.json',
78+
json: true,
79+
open: false
80+
})
81+
],
7382
output: {
7483
manualChunks(id) {
7584
if (id.includes('node_modules')) {

0 commit comments

Comments
 (0)