Skip to content

Commit

Permalink
fix(ssr): emit js sourcemaps for ssr builds (#11343)
Browse files Browse the repository at this point in the history
  • Loading branch information
thebanjomatic committed Dec 31, 2022
1 parent 7d20580 commit f12a1ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite/src/node/plugins/asset.ts
Expand Up @@ -23,6 +23,7 @@ export const assetUrlRE = /__VITE_ASSET__([a-z\d]+)__(?:\$_(.*?)__)?/g

const rawRE = /(?:\?|&)raw(?:&|$)/
const urlRE = /(\?|&)url(?:&|$)/
const jsSourceMapRE = /\.[cm]?js\.map$/

const assetCache = new WeakMap<ResolvedConfig, Map<string, string>>()

Expand Down Expand Up @@ -190,7 +191,8 @@ export function assetPlugin(config: ResolvedConfig): Plugin {
for (const file in bundle) {
if (
bundle[file].type === 'asset' &&
!file.includes('ssr-manifest.json')
!file.endsWith('ssr-manifest.json') &&
!jsSourceMapRE.test(file)
) {
delete bundle[file]
}
Expand Down

0 comments on commit f12a1ab

Please sign in to comment.