Skip to content

Commit f12a1ab

Browse files
authoredDec 31, 2022
fix(ssr): emit js sourcemaps for ssr builds (#11343)
1 parent 7d20580 commit f12a1ab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎packages/vite/src/node/plugins/asset.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const assetUrlRE = /__VITE_ASSET__([a-z\d]+)__(?:\$_(.*?)__)?/g
2323

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

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

@@ -190,7 +191,8 @@ export function assetPlugin(config: ResolvedConfig): Plugin {
190191
for (const file in bundle) {
191192
if (
192193
bundle[file].type === 'asset' &&
193-
!file.includes('ssr-manifest.json')
194+
!file.endsWith('ssr-manifest.json') &&
195+
!jsSourceMapRE.test(file)
194196
) {
195197
delete bundle[file]
196198
}

0 commit comments

Comments
 (0)