The best way to control Claude Code, Codex and more from any computer or phone
| 1 | // `playground/main-resolution/vite.config.virtual-module-main.ts`. |
| 2 | export default { |
| 3 | plugins: [ |
| 4 | { |
| 5 | name: "virtual-module-plugin", |
| 6 | resolveId(source: string) { |
| 7 | if (source === "virtual:entry") { |
| 8 | return `\0${source}`; |
| 9 | } |
| 10 | }, |
| 11 | load(id: string) { |
| 12 | if (id === "\0virtual:entry") { |
| 13 | return ` |
| 14 | export default { |
| 15 | fetch() { |
| 16 | return new Response("Virtual module as Worker entry file"); |
| 17 | } |
| 18 | } |
| 19 | `; |
| 20 | } |
| 21 | }, |
| 22 | }, |
| 23 | ], |
| 24 | }; |