Skip to content

Commit 19d2dd6

Browse files
committed
fix(rsc): keep import.meta.glob during scan build for rolldown-vite
1 parent 71bb49c commit 19d2dd6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export function Repro() {
2+
return (
3+
<div>
4+
<form
5+
action={async () => {
6+
'use server'
7+
console.log('repro')
8+
}}
9+
>
10+
<button>repro</button>
11+
</form>
12+
</div>
13+
)
14+
}

packages/plugin-rsc/src/plugin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,10 @@ function scanBuildStripPlugin(): Plugin {
914914
.map((e) => e.n && `import ${JSON.stringify(e.n)};\n`)
915915
.filter(Boolean)
916916
.join('')
917+
918+
// TODO: keep also import.meta.glob for rolldown-vite
919+
// https://github.com/vitejs/rolldown-vite/issues/373
920+
917921
return { code: output, map: { mappings: '' } }
918922
},
919923
}

0 commit comments

Comments
 (0)