Skip to content

Commit

Permalink
wip: do not emit assets in ssr build
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 18, 2021
1 parent 613c6bb commit ffaf50d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/vite/src/node/plugins/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ export function assetPlugin(config: ResolvedConfig): Plugin {
} else {
return null
}
},

generateBundle(_, bundle) {
// do not emit assets for SSR build
if (config.command === 'build' && config.build.ssr) {
for (const file in bundle) {
if (bundle[file].type === 'asset') {
delete bundle[file]
}
}
}
}
}
}
Expand Down

0 comments on commit ffaf50d

Please sign in to comment.