From d35db4434d583043c1c01996c282a3a7ccf1374a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E9=A2=A2?= Date: Wed, 16 Jan 2019 14:50:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20DLL=20=E6=9B=B4=E6=96=B0=20dev=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E4=B8=8D=E5=BA=94=E8=AF=A5=E9=87=8D=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/render.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/render.ts b/src/render.ts index b76c21f..d484150 100644 --- a/src/render.ts +++ b/src/render.ts @@ -56,7 +56,9 @@ export function serverDevRender(app: Express) { const templatePath = config.render ? config.render.options.templatePath : '' - const clientManifest: any = renderOptions.clientManifest + const clientManifest: any = clientManifestAddDll( + renderOptions.clientManifest + ) render = getRender( createBundleRenderer(renderOptions.bundle, { ...(BASE_RENDER_OPTIONS as any), @@ -78,10 +80,8 @@ export function serverDevRender(app: Express) { stats.warnings.forEach((err: any) => consola.info(err)) if (stats.errors.length) return - renderOptions.clientManifest = clientManifestAddDll( - JSON.parse( - readFile(devMiddleware.fileSystem, 'vue-ssr-client-manifest.json') - ) + renderOptions.clientManifest = JSON.parse( + readFile(devMiddleware.fileSystem, 'vue-ssr-client-manifest.json') ) update('clientManifest') } @@ -131,13 +131,17 @@ export function serverDevRender(app: Express) { } function clientManifestAddDll(clientManifest: any) { + clientManifest = JSON.parse(JSON.stringify(clientManifest)) const config = getConfig() if (config.webpack && config.webpack.client && config.webpack.client.output) if (config.webpack.dll) { try { const dllManifest = JSON.parse( readFileSync( - path.resolve(config.webpack.dll.path, './vue-ssr-dll-manifest.json'), + path.resolve( + config.webpack.dll.path, + './vue-ssr-dll-manifest.json' + ), 'utf-8' ) )