| 5 | import { renderToString } from "http://localhost:8080/solid-js@1.5.1/web"; |
| 6 | |
| 7 | function transformSolid(rawCode: string): string { |
| 8 | const { code } = transform(rawCode, { |
| 9 | presets: [ |
| 10 | [babelPresetSolid, { |
| 11 | generate: "ssr", |
| 12 | hydratable: false, |
| 13 | }], |
| 14 | ["typescript", { onlyRemoveTypeImports: true }], |
| 15 | ], |
| 16 | filename: "main.jsx", |
| 17 | }); |
| 18 | if (!code) { |
| 19 | throw new Error("code is empty"); |
| 20 | } |
| 21 | return code |
| 22 | .replaceAll(`"solid-js"`, `"http://localhost:8080/solid-js@1.5.1"`) |
| 23 | .replaceAll(`"solid-js/web"`, `"http://localhost:8080/solid-js@1.5.1/web"`); |
| 24 | } |
| 25 | |
| 26 | Deno.test("solid-js@1.5 ssr", async () => { |
| 27 | const code = `import { createSignal } from "solid-js"; |