Skip to content

chore: use Rolldown bundle analyzer instead of rollup-plugin-visualizer - #343

Merged
stipsan merged 3 commits into
mainfrom
cursor/rolldown-bundle-analyzer-6e6c
Sep 1, 2026
Merged

stipsan merged 3 commits into
mainfrom
cursor/rolldown-bundle-analyzer-6e6c

Conversation

@stipsan

@stipsan stipsan commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

Replace rollup-plugin-visualizer with @sanity/tsdown-config’s built-in bundleAnalyzer option. No direct rolldown dependency.

Library (tsdown.config.ts)

  • bundleAnalyzer: process.env['ENABLE_BUNDLE_ANALYZER'] === 'true'
  • pnpm analyze emits dist/analyze-data.md
  • !dist/analyze-data.md so the report cannot be published

Demo

  • Drops rollup-plugin-visualizer and the hand-rolled rolldown/experimental plugin
  • Vite config is just the React Compiler plugin

Deps

  • @sanity/tsdown-config ^0.27.1
  • @vitejs/plugin-react ^6.1.1
  • Lockfile resolved to a single rolldown@1.2.6 so the BuiltinPlugin actually emits the report
Open in Web Open in Cursor 

@changeset-bot

changeset-bot Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: de9beb3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@stipsan
stipsan marked this pull request as ready for review August 18, 2026 10:12
Swap the demo Vite build to rolldown/experimental bundleAnalyzerPlugin, and
gate the published-package report behind @sanity/tsdown-config's bundleAnalyzer
option (ENABLE_BUNDLE_ANALYZER=true).

Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/rolldown-bundle-analyzer-6e6c branch from 0d28358 to 1cfb335 Compare August 27, 2026 22:52
@sanity/tsdown-config 0.27.1 already wires Rolldown's bundle analyzer, so the
demo no longer imports rolldown/experimental and package.json no longer lists
rolldown.

Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
@socket-security

socket-security Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​sanity/​tsdown-config@​0.27.18810010098100
Added@​vitejs/​plugin-react@​6.1.110010010095100

View full report

Without a direct rolldown dependency, the lockfile had 1.2.5 (tsdown) and
1.2.6 (tsdown-config), so the analyzer plugin never emitted analyze-data.md.

Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
@stipsan
stipsan merged commit e678753 into main Sep 1, 2026
10 checks passed
@stipsan
stipsan deleted the cursor/rolldown-bundle-analyzer-6e6c branch September 1, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants