File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { errMsg } from '../err-msg.js' ;
2
+ import { resolveUrl } from '../common.js' ;
2
3
import { importMap } from '../features/import-maps.js' ;
3
4
import { systemJSPrototype } from '../system-core.js' ;
4
5
@@ -28,6 +29,13 @@ systemJSPrototype.instantiate = function (url, parent) {
28
29
if ( ! contentType || ! jsContentTypeRegEx . test ( contentType ) )
29
30
throw Error ( errMsg ( 4 , process . env . SYSTEM_PRODUCTION ? contentType : 'Unknown Content-Type "' + contentType + '", loading ' + url + ( parent ? ' from ' + parent : '' ) ) ) ;
30
31
return res . text ( ) . then ( function ( source ) {
32
+ var sourceMappingIndex = source . lastIndexOf ( '//# sourceMappingURL=' ) ;
33
+ if ( sourceMappingIndex > - 1 ) {
34
+ var sourceMappingEnd = source . indexOf ( '\n' , sourceMappingIndex ) ;
35
+ var sourceMapping = source . slice ( sourceMappingIndex , sourceMappingEnd > - 1 ? sourceMappingEnd : undefined ) ;
36
+ source += '\n//# sourceMappingURL=' + resolveUrl ( sourceMapping . slice ( 21 ) , url ) ;
37
+ }
38
+ source += '\n//# sourceURL=' + url ;
31
39
( 0 , eval ) ( source ) ;
32
40
return loader . getRegister ( ) ;
33
41
} ) ;
You can’t perform that action at this time.
0 commit comments