diff options
author | 2021-04-02 10:16:16 -0600 | |
---|---|---|
committer | 2021-04-02 10:16:16 -0600 | |
commit | 003b3c395f81df26010112928a30c2d88f283b53 (patch) | |
tree | 6dd9057a0758eb1030018062a72126a8efb9f098 /src/frontend/render/renderer.ts | |
parent | 2646f800af80703ae6498232d270a4637fe56dca (diff) | |
download | astro-003b3c395f81df26010112928a30c2d88f283b53.tar.gz astro-003b3c395f81df26010112928a30c2d88f283b53.tar.zst astro-003b3c395f81df26010112928a30c2d88f283b53.zip |
Get CSS Modules working in Vue (#53)
Diffstat (limited to 'src/frontend/render/renderer.ts')
-rw-r--r-- | src/frontend/render/renderer.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/frontend/render/renderer.ts b/src/frontend/render/renderer.ts index 272f4ef5c..e0d1fccce 100644 --- a/src/frontend/render/renderer.ts +++ b/src/frontend/render/renderer.ts @@ -5,7 +5,7 @@ interface DynamicRenderContext { } export interface Renderer { - renderStatic(Component: any): (props: Record<string, any>, ...children: any[]) => string; + renderStatic(Component: any): (props: Record<string, any>, ...children: any[]) => Promise<string>; render(context: { root: string; Component: string; props: string; [key: string]: string }): string; imports?: Record<string, string[]>; } @@ -36,10 +36,10 @@ export function createRenderer(renderer: Renderer) { wrapperEnd: string | ((context: ReturnType<typeof createContext>) => string) ) => (Component: any, renderContext: DynamicRenderContext) => { const innerContext = createContext(); - return (props: Record<string, any>, ...children: any[]) => { + return async (props: Record<string, any>, ...children: any[]) => { let value: string; try { - value = _static(Component)(props, ...children); + value = await _static(Component)(props, ...children); } catch (e) { value = ''; } |