This repository was archived by the owner on May 1, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -89,15 +89,18 @@ export function rollupWorker(context: BuildContext, configFile: string): Promise
89
89
}
90
90
91
91
const bundleOutput = bundle . generate ( {
92
- format : rollupConfig . format
92
+ format : rollupConfig . format ,
93
+ sourceMap : rollupConfig . sourceMap
93
94
} ) ;
94
95
95
96
// write the bundle
96
- const jsFileToWrite = join ( context . buildDir , rollupConfig . dest ) ;
97
97
const promises : Promise < any > [ ] = [ ] ;
98
- promises . push ( writeFileAsync ( jsFileToWrite , bundleOutput . code ) ) ;
98
+ promises . push ( writeFileAsync ( rollupConfig . dest , bundleOutput . code ) ) ;
99
+ context . fileCache . set ( rollupConfig . dest , { path : rollupConfig . dest , content : bundleOutput . code } ) ;
99
100
if ( bundleOutput . map ) {
100
- promises . push ( writeFileAsync ( jsFileToWrite + '.map' , bundleOutput . map ) ) ;
101
+ const sourceMapContent = bundleOutput . map . toString ( ) ;
102
+ promises . push ( writeFileAsync ( rollupConfig . dest + '.map' , sourceMapContent ) ) ;
103
+ context . fileCache . set ( rollupConfig . dest + '.map' , { path : rollupConfig . dest + '.map' , content : sourceMapContent } ) ;
101
104
}
102
105
return Promise . all ( promises ) ;
103
106
} )
You can’t perform that action at this time.
0 commit comments