Skip to content

Commit

Permalink
chore: switch to vite-bundle-analyzer (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz authored Mar 17, 2024
1 parent 3d283ae commit 01532fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@
"react-refresh": "^0.9.0",
"rimraf": "^5.0.5",
"rollup": "^4.4.0",
"rollup-plugin-bundle-analyzer": "^1.6.6",
"rollup-plugin-commonjs-alternate": "^0.8.0",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-hot-css": "^0.7.2",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-react-refresh": "^0.0.3",
"rollup-plugin-static-files": "^0.2.0",
"rollup-plugin-swc3": "^0.10.3",
"sass": "^1.69.5"
"sass": "^1.69.5",
"vite-bundle-analyzer": "^0.9.0"
},
"peerDependencies": {
"preact": "^10.7.1",
Expand Down
7 changes: 4 additions & 3 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import alias from '@rollup/plugin-alias';
import { dts } from 'rollup-plugin-dts';
import bundleAnalyzer from 'rollup-plugin-bundle-analyzer';
import { adapter, analyzer } from 'vite-bundle-analyzer';

import type { RollupCache, RollupOptions } from 'rollup';
import type { JscTarget } from '@swc/core';
Expand Down Expand Up @@ -100,15 +100,16 @@ const outputMatrix = (config: {
externalHelpers: true,
target: config.target,
minify: config.minify
? { compress: { unsafe: true }, mangle: true, module: true }
? { compress: { unsafe: true }, mangle: true, module: true, sourceMap: true }
: undefined
},
minify: config.minify,
sourceMaps: true,
module: {
type: 'es6'
}
})),
process.env.ANALYZE === 'true' && bundleAnalyzer({})
process.env.ANALYZE === 'true' && adapter(analyzer())
],
external: config.bundle
? undefined
Expand Down

0 comments on commit 01532fb

Please sign in to comment.