File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -222,23 +222,15 @@ protected virtual JavaScriptWithSourceMap TransformWithHeader(
222222 string hash = null
223223 )
224224 {
225+ var result = TransformWithSourceMap ( contents , filename ) ;
225226 if ( string . IsNullOrEmpty ( hash ) )
226227 {
227228 hash = _fileCacheHash . CalculateHash ( contents ) ;
228229 }
230+ // Prepend header to generated code
229231 var header = GetFileHeader ( hash ) ;
230- var result = TransformWithSourceMap ( header + contents , filename ) ;
232+ result . Code = header + result . Code ;
231233 result . Hash = hash ;
232- if ( result . SourceMap != null )
233- {
234- // Insert original source into source map so the browser doesn't have to do a second
235- // request for it. The newlines in the beginning are a hack so the line numbers line
236- // up (as the original file doesn't have the header the transformed file includes).
237- result . SourceMap . Sources = new [ ] { Path . GetFileName ( filename ) + ".source" } ;
238- result . SourceMap . SourcesContent = new [ ] { new string ( '\n ' , LINES_IN_HEADER ) + contents } ;
239- result . SourceMap . File = null ;
240- }
241-
242234 return result ;
243235 }
244236
You can’t perform that action at this time.
0 commit comments