Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
Name AMD modules foo rather than foo/index.
Browse files Browse the repository at this point in the history
Fixes angular/angular#23810

PiperOrigin-RevId: 196142916
  • Loading branch information
alexeagle committed May 10, 2018
1 parent 3caf55c commit c7b6880
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/tsc_wrapped/compiler_host.ts
Expand Up @@ -321,6 +321,13 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost {
relativeFileName) {
return this.bazelOpts.moduleName;
}
// Support the common case of commonjs convention that index is the
// default module in a directory.
// This makes our module naming scheme more conventional and lets users
// refer to modules with the natural name they're used to.
if (relativeFileName === 'index') {
return this.bazelOpts.moduleName;
}
return path.posix.join(this.bazelOpts.moduleName, relativeFileName);
}
}
Expand Down

0 comments on commit c7b6880

Please sign in to comment.