Skip to content

Commit

Permalink
fix(@ngtools/webpack): honor tsconfig#angularCompilerOptions.entryMod…
Browse files Browse the repository at this point in the history
…ule before trying to resolveEntryModuleFromMain() (#4013)
  • Loading branch information
tsabirgaliev authored and hansl committed Jan 15, 2017
1 parent 5a27fdb commit c9ac263
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/@ngtools/webpack/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,16 @@ export class AotPlugin implements Tapable {

if (options.entryModule) {
this._entryModule = options.entryModule;
} else {
if (options.mainPath) {
this._entryModule = resolveEntryModuleFromMain(options.mainPath, this._compilerHost,
this._program);
} else {
this._entryModule = (tsConfig.raw['angularCompilerOptions'] as any).entryModule;
}
} else if ((tsConfig.raw['angularCompilerOptions'] as any)
&& (tsConfig.raw['angularCompilerOptions'] as any).entryModule) {
this._entryModule = path.resolve(this._basePath,
(tsConfig.raw['angularCompilerOptions'] as any).entryModule);
}

// still no _entryModule? => try to resolve from mainPath
if (!this._entryModule && options.mainPath) {
this._entryModule = resolveEntryModuleFromMain(options.mainPath, this._compilerHost,
this._program);
}

if (options.hasOwnProperty('i18nFile')) {
Expand Down

0 comments on commit c9ac263

Please sign in to comment.