The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 07:15 UTC
| 1 | // Mirrors `@cloudflare/vite-plugin`'s `playground/module-resolution`: a user |
| 2 | // alias, and an optimizeDeps-excluded package importing a virtual module. |
| 3 | // Also `playground/virtual-modules`: a Worker imports a plugin's virtual |
| 4 | // module. The `@playground/*` packages are installed into `node_modules` by the test. |
| 5 | import { resolve } from "node:path"; |
| 6 | // @ts-expect-error Missing types |
| 7 | import testDepPlugin from "@playground/module-resolution-excludes/plugin"; |
| 8 | |
| 9 | export default { |
| 10 | resolve: { |
| 11 | alias: { |
| 12 | "@alias/test": resolve(import.meta.dirname, "./src/aliasing.ts"), |
| 13 | }, |
| 14 | }, |
| 15 | environments: { |
| 16 | ssr: { |
| 17 | optimizeDeps: { |
| 18 | exclude: ["@playground/module-resolution-excludes"], |
| 19 | }, |
| 20 | }, |
| 21 | }, |
| 22 | plugins: [ |
| 23 | { |
| 24 | name: "virtual-module-plugin", |
| 25 | resolveId(id: string) { |
| 26 | if (id === "virtual:module") { |
| 27 | return `\0virtual:module`; |
| 28 | } |
| 29 | }, |
| 30 | load(id: string) { |
| 31 | if (id === "\0virtual:module") { |
| 32 | return `export default 'virtual module'`; |
| 33 | } |
| 34 | }, |
| 35 | }, |
| 36 | testDepPlugin(), |
| 37 | ], |
| 38 | }; |