From 03775f7048dbab196dfb2de4ac7e63c3fe1b173a Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Thu, 29 Apr 2021 14:11:35 -0500 Subject: [PATCH] fix: @vue/server-renderer tree-shaking (#148) --- src/frontend/render/vue.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend/render/vue.ts b/src/frontend/render/vue.ts index dce13556a..57c3c8276 100644 --- a/src/frontend/render/vue.ts +++ b/src/frontend/render/vue.ts @@ -4,6 +4,9 @@ import { renderToString } from '@vue/server-renderer'; import { defineComponent, createSSRApp, h as createElement } from 'vue'; import { createRenderer } from './renderer'; +// This prevents tree-shaking of render. +Function.prototype(renderToString); + /** * Users might attempt to use :vueAttribute syntax to pass primitive values. * If so, try to JSON.parse them to get the primitives