@@ -680,7 +680,7 @@ export class Application implements ServerApplication {
680
680
if ( isRemote ) {
681
681
mod . jsFile = util . cleanPath ( `${ saveDir } /${ name } .js` )
682
682
} else {
683
- mod . jsFile = `${ saveDir } /${ name } .${ mod . hash . slice ( 0 , hashShortLength ) } .js`
683
+ mod . jsFile = util . cleanPath ( `${ saveDir } /${ name } .${ mod . hash . slice ( 0 , hashShortLength ) } .js` )
684
684
}
685
685
686
686
// check previous compilation output if the source content doesn't changed.
@@ -790,15 +790,13 @@ export class Application implements ServerApplication {
790
790
if ( jsContent === '' ) {
791
791
jsContent = await Deno . readTextFile ( mod . jsFile )
792
792
}
793
- const newContent = jsContent . replace (
794
- reHashResolve ,
795
- ( s , key , spaces , ql , importPath , qr ) => {
796
- const importPathname = importPath . replace ( reHashJs , '' )
797
- if ( importPathname == dep . url || importPathname === relativePathname ) {
798
- return `${ key } ${ spaces } ${ ql } ${ importPathname } .${ dep . hash . slice ( 0 , hashShortLength ) } .js${ qr } `
799
- }
800
- return s
793
+ const newContent = jsContent . replace ( reHashResolve , ( s , key , spaces , ql , importPath , qr ) => {
794
+ const importPathname = importPath . replace ( reHashJs , '' )
795
+ if ( importPathname == dep . url || importPathname === relativePathname ) {
796
+ return `${ key } ${ spaces } ${ ql } ${ importPathname } .${ dep . hash . slice ( 0 , hashShortLength ) } .js${ qr } `
801
797
}
798
+ return s
799
+ }
802
800
)
803
801
if ( newContent !== jsContent ) {
804
802
jsContent = newContent
@@ -813,13 +811,13 @@ export class Application implements ServerApplication {
813
811
if ( fsync ) {
814
812
await clearCompilation ( mod . jsFile )
815
813
await Promise . all ( [
816
- ensureTextFile ( mod . jsFile , jsContent + ( jsSourceMap ? `//# sourceMappingURL=${ path . basename ( mod . jsFile ) } .map` : '' ) ) ,
817
- jsSourceMap ? ensureTextFile ( mod . jsFile + '.map' , jsSourceMap ) : Promise . resolve ( ) ,
818
814
ensureTextFile ( metaFile , JSON . stringify ( {
819
815
url,
820
816
sourceHash : mod . sourceHash ,
821
817
deps : mod . deps ,
822
818
} , undefined , 2 ) ) ,
819
+ ensureTextFile ( mod . jsFile , jsContent + ( jsSourceMap ? `//# sourceMappingURL=${ path . basename ( mod . jsFile ) } .map` : '' ) ) ,
820
+ jsSourceMap ? ensureTextFile ( mod . jsFile + '.map' , jsSourceMap ) : Promise . resolve ( ) ,
823
821
] )
824
822
}
825
823
0 commit comments