Skip to content

Commit 7e18bf8

Browse files
authored
fix: return sourcemap field from some plugins that were lacking (#22782)
1 parent 2ce6677 commit 7e18bf8

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

packages/vite/src/node/plugins/css.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,10 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
554554
`${getHash(cleanUrl(id))}_${Number.parseInt(index)}`,
555555
css,
556556
)
557-
return `export default ''`
557+
return {
558+
code: `export default ''`,
559+
map: { mappings: '' },
560+
}
558561
}
559562

560563
const inlined = inlineRE.test(id)

packages/vite/src/node/plugins/html.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,11 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
813813

814814
// Force rollup to keep this module from being shared between other entry points.
815815
// If the resulting chunk is empty, it will be removed in generateBundle.
816-
return { code: js, moduleSideEffects: 'no-treeshake' }
816+
return {
817+
code: js,
818+
map: { mappings: '' },
819+
moduleSideEffects: 'no-treeshake',
820+
}
817821
},
818822
},
819823

0 commit comments

Comments
 (0)