Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/slow-seahorses-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/router-core': patch
---

prevent isServer exports from being transformed to top-level vars so rspack can dead-code eliminate them
7 changes: 7 additions & 0 deletions packages/router-core/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import type { ViteUserConfig } from 'vitest/config'

const config = defineConfig({
plugins: [minifyScriptPlugin()] as ViteUserConfig['plugins'],
build: {
rolldownOptions: {
output: {
topLevelVar: false,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the document here: https://rolldown.rs/reference/OutputOptions.topLevelVar

It is default to ‘false’.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
},
},
test: {
name: packageJson.name,
dir: './tests',
Expand Down
Loading