From 49e4c038b58720d6be29e3fc28359c0b33d71be2 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 19 Apr 2021 22:41:47 +0200 Subject: [PATCH] fix(nitro): resolve default export for assets --- packages/nitro/src/rollup/plugins/assets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nitro/src/rollup/plugins/assets.ts b/packages/nitro/src/rollup/plugins/assets.ts index efa821e457..e7e8f250ab 100644 --- a/packages/nitro/src/rollup/plugins/assets.ts +++ b/packages/nitro/src/rollup/plugins/assets.ts @@ -88,7 +88,7 @@ export function getAsset (id) { } } const inlineAssets = `const assets = {\n${Object.keys(assets).map(id => - ` ['${id}']: {\n read: () => import('${assets[id].fsPath}'),\n meta: ${JSON.stringify(assets[id].meta)}\n }` + ` ['${id}']: {\n read: () => import('${assets[id].fsPath}').then(r => r.default || r),\n meta: ${JSON.stringify(assets[id].meta)}\n }` ).join(',\n')}\n}` return `${inlineAssets}\n${assetUtils} export function getAsset (id) {