Skip to content
12 changes: 10 additions & 2 deletions .github/workflows/ci-rsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,21 @@ jobs:
- run: pnpm -C packages/plugin-rsc test

test-e2e:
name: test-rsc (${{ matrix.os }} / ${{ matrix.browser }})
name: test-rsc (${{ matrix.os }} / ${{ matrix.browser }}) ${{ matrix.rolldown == true && '(rolldown)' || '' }}
runs-on: ${{ matrix.os }}
strategy:
# TODO: shard?
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
browser: [chromium]
rolldown: [false]
include:
- os: ubuntu-latest
browser: firefox
- os: macos-latest
browser: webkit
- os: ubuntu-latest
browser: chromium
rolldown: true
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -52,6 +55,11 @@ jobs:
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- run: pnpm i
- run: pnpm build
- name: install rolldown
if: ${{ matrix.rolldown }}
run: |
echo 'overrides: { vite: "npm:rolldown-vite@latest" }' >> pnpm-workspace.yaml
pnpm i --no-frozen-lockfile
- run: pnpm -C packages/plugin-rsc exec playwright install ${{ matrix.browser }}
- run: pnpm -C packages/plugin-rsc test-e2e-ci --project=${{ matrix.browser }}
env:
Expand Down
12 changes: 12 additions & 0 deletions packages/plugin-rsc/examples/react-router/cf/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,24 @@ export default defineConfig({
include: ['react-router > cookie', 'react-router > set-cookie-parser'],
exclude: ['react-router'],
},
build: {
rollupOptions: {
// @ts-ignore rolldown
platform: 'neutral',
},
},
},
rsc: {
optimizeDeps: {
include: ['react-router > cookie', 'react-router > set-cookie-parser'],
exclude: ['react-router'],
},
build: {
rollupOptions: {
// @ts-ignore rolldown
platform: 'neutral',
},
},
},
},
})
12 changes: 10 additions & 2 deletions packages/plugin-rsc/examples/starter-cf-single/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import rsc from '@vitejs/plugin-rsc'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'

export default defineConfig((_env) => ({
export default defineConfig({
clearScreen: false,
build: {
minify: false,
Expand Down Expand Up @@ -31,6 +31,14 @@ export default defineConfig((_env) => ({
rollupOptions: {
// ensure `default` export only in cloudflare entry output
preserveEntrySignatures: 'exports-only',
// @ts-ignore rolldown
platform: 'neutral',
},
},
optimizeDeps: {
// @ts-ignore rolldown
rollupOptions: {
platform: 'neutral',
},
},
},
Expand All @@ -43,4 +51,4 @@ export default defineConfig((_env) => ({
},
},
},
}))
})
Loading