diff --git a/.github/workflows/ci-rsc.yml b/.github/workflows/ci-rsc.yml index d3bf406db..b21b0d0b3 100644 --- a/.github/workflows/ci-rsc.yml +++ b/.github/workflows/ci-rsc.yml @@ -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 @@ -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: diff --git a/packages/plugin-rsc/examples/react-router/cf/vite.config.ts b/packages/plugin-rsc/examples/react-router/cf/vite.config.ts index 8cf7a02f5..ee9f9bcf3 100644 --- a/packages/plugin-rsc/examples/react-router/cf/vite.config.ts +++ b/packages/plugin-rsc/examples/react-router/cf/vite.config.ts @@ -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', + }, + }, }, }, }) diff --git a/packages/plugin-rsc/examples/starter-cf-single/vite.config.ts b/packages/plugin-rsc/examples/starter-cf-single/vite.config.ts index 4ca6437be..9df9911f8 100644 --- a/packages/plugin-rsc/examples/starter-cf-single/vite.config.ts +++ b/packages/plugin-rsc/examples/starter-cf-single/vite.config.ts @@ -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, @@ -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', }, }, }, @@ -43,4 +51,4 @@ export default defineConfig((_env) => ({ }, }, }, -})) +})