File tree 1 file changed +5
-9
lines changed
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -1956,21 +1956,17 @@ class Server {
1956
1956
splitKey . length - 1 === splitOutputFilename . length &&
1957
1957
splitKey [ 0 ] === outputFilename . split ( "." ) [ 0 ]
1958
1958
) {
1959
- extension = splitKey [ splitKey . length - 1 ] ;
1959
+ extension = path . extname ( key ) ;
1960
1960
isOutputModule = value . javascriptModule ;
1961
1961
}
1962
1962
} ) ;
1963
1963
1964
1964
if ( isOutputModule ) {
1965
- filename = this . middleware . getFilenameFromUrl (
1966
- `${ _path } .${ extension } `
1967
- ) ;
1965
+ filename = this . middleware . getFilenameFromUrl ( `${ _path } ${ extension } ` ) ;
1968
1966
scriptType = "module" ;
1969
1967
} else {
1970
- extension = "js" ;
1971
- filename = this . middleware . getFilenameFromUrl (
1972
- `${ _path } .${ extension } `
1973
- ) ;
1968
+ extension = ".js" ;
1969
+ filename = this . middleware . getFilenameFromUrl ( `${ _path } ${ extension } ` ) ;
1974
1970
scriptType = "text/javascript" ;
1975
1971
}
1976
1972
@@ -1984,7 +1980,7 @@ class Server {
1984
1980
1985
1981
// Serve a page that executes the javascript
1986
1982
const queries = req . _parsedUrl . search || "" ;
1987
- const responsePage = `<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body><script type="${ scriptType } " charset="utf-8" src="${ _path } . ${ extension } ${ queries } "></script></body></html>` ;
1983
+ const responsePage = `<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body><script type="${ scriptType } " charset="utf-8" src="${ _path } ${ extension } ${ queries } "></script></body></html>` ;
1988
1984
1989
1985
res . send ( responsePage ) ;
1990
1986
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments