File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,11 @@ export function PrerenderPlugin({
221221
222222 let prerenderEntry : OutputChunk | undefined ;
223223 for ( const output of Object . keys ( bundle ) ) {
224+ // Clean up source maps if the user didn't enable them themselves
225+ if ( / \. m a p $ / . test ( output ) && ! userEnabledSourceMaps ) {
226+ delete bundle [ output ] ;
227+ continue ;
228+ }
224229 if ( ! / \. j s $ / . test ( output ) || bundle [ output ] . type !== "chunk" ) continue ;
225230
226231 await fs . writeFile (
@@ -407,14 +412,5 @@ export function PrerenderPlugin({
407412 } ) ;
408413 }
409414 } ,
410- async writeBundle ( _opts , bundle ) {
411- if ( ! userEnabledSourceMaps ) {
412- Object . keys ( bundle )
413- . filter ( f => / \. m a p $ / . test ( f ) )
414- . forEach ( async f => {
415- fs . rm ( path . join ( viteConfig . root , viteConfig . build . outDir , f ) ) ;
416- } ) ;
417- }
418- } ,
419415 } ;
420416}
You can’t perform that action at this time.
0 commit comments