|
1 | 1 | import { join } from "node:path"; |
2 | 2 | import { readFile, rm } from "node:fs/promises"; |
3 | | -import type { WsComponentMeta } from "@webstudio-is/sdk"; |
| 3 | +import { isPathnamePattern, type WsComponentMeta } from "@webstudio-is/sdk"; |
4 | 4 | import * as baseComponentMetas from "@webstudio-is/sdk-components-react/metas"; |
5 | 5 | import * as animationComponentMetas from "@webstudio-is/sdk-components-animation/metas"; |
6 | 6 | import * as radixComponentMetas from "@webstudio-is/sdk-components-react-radix/metas"; |
@@ -59,20 +59,26 @@ export const createFramework = async (): Promise<Framework> => { |
59 | 59 | metas: radixComponentNamespacedMetas, |
60 | 60 | }, |
61 | 61 | ], |
62 | | - html: ({ pagePath }: { pagePath: string }) => [ |
63 | | - { |
64 | | - file: join("pages", generateVikeRoute(pagePath), "+Page.tsx"), |
65 | | - template: htmlPageTemplate, |
66 | | - }, |
67 | | - { |
68 | | - file: join("pages", generateVikeRoute(pagePath), "+Head.tsx"), |
69 | | - template: htmlHeadTemplate, |
70 | | - }, |
71 | | - { |
72 | | - file: join("pages", generateVikeRoute(pagePath), "+data.ts"), |
73 | | - template: htmlDataTemplate, |
74 | | - }, |
75 | | - ], |
| 62 | + html: ({ pagePath }: { pagePath: string }) => { |
| 63 | + // ignore dynamic pages in static export |
| 64 | + if (isPathnamePattern(pagePath)) { |
| 65 | + return []; |
| 66 | + } |
| 67 | + return [ |
| 68 | + { |
| 69 | + file: join("pages", generateVikeRoute(pagePath), "+Page.tsx"), |
| 70 | + template: htmlPageTemplate, |
| 71 | + }, |
| 72 | + { |
| 73 | + file: join("pages", generateVikeRoute(pagePath), "+Head.tsx"), |
| 74 | + template: htmlHeadTemplate, |
| 75 | + }, |
| 76 | + { |
| 77 | + file: join("pages", generateVikeRoute(pagePath), "+data.ts"), |
| 78 | + template: htmlDataTemplate, |
| 79 | + }, |
| 80 | + ]; |
| 81 | + }, |
76 | 82 | xml: () => [], |
77 | 83 | redirect: () => [], |
78 | 84 | defaultSitemap: () => [], |
|
0 commit comments