File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ function denoify() {
2424 // convert self-referencing module specifiers to relative paths
2525 specifier = file . getRelativePathAsModuleSpecifierTo ( denoDir + specifier . substring ( pkgName . length ) ) ;
2626 } else if ( ! decl . isModuleSpecifierRelative ( ) ) {
27- continue ;
27+ specifier = `npm: ${ specifier } ` ;
2828 }
2929
30- if ( decl . isModuleSpecifierRelative ( ) ) {
30+ if ( specifier . startsWith ( './' ) || specifier . startsWith ( '../' ) ) {
3131 // there may be CJS directory module specifiers that implicitly resolve
3232 // to /index.ts. Add an explicit /index.ts to the end
3333 const sourceFile = decl . getModuleSpecifierSourceFile ( ) ;
@@ -38,9 +38,9 @@ function denoify() {
3838 ) {
3939 specifier += '/' + path . basename ( sourceFile . getFilePath ( ) ) ;
4040 }
41+ // add explicit .ts file extensions to relative module specifiers
42+ specifier = specifier . replace ( / ( \. [ ^ . / ] * ) ? $ / , '.ts' ) ;
4143 }
42- // add explicit .ts file extensions to relative module specifiers
43- specifier = specifier . replace ( / ( \. [ ^ . / ] * ) ? $ / , '.ts' ) ;
4444 moduleSpecifier . replaceWithText ( JSON . stringify ( specifier ) ) ;
4545 }
4646
You can’t perform that action at this time.
0 commit comments