Navigation Menu

Skip to content

Commit

Permalink
fix(server-assets): escape asset file names
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 1, 2022
1 parent 6104c54 commit 7aaab6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rollup/plugins/server-assets.ts
Expand Up @@ -74,7 +74,7 @@ for (const asset of serverAssets) {
function getAssetProd (assets: Record<string, ResolvedAsset>) {
return `
const _assets = {\n${Object.entries(assets).map(([id, asset]) =>
` ['${normalizeKey(id)}']: {\n import: () => import('raw:${asset.fsPath}').then(r => r.default || r),\n meta: ${JSON.stringify(asset.meta)}\n }`
` [${JSON.stringify(normalizeKey(id))}]: {\n import: () => import(${JSON.stringify('raw:' + asset.fsPath)}).then(r => r.default || r),\n meta: ${JSON.stringify(asset.meta)}\n }`
).join(',\n')}\n}
${normalizeKey.toString()}
Expand Down

0 comments on commit 7aaab6d

Please sign in to comment.