Skip to content

Commit b873677

Browse files
committed
@ngtools/webpack: honor tsconfig#angularCompilerOptions.entryModule before falling back to resolveEntryModuleFromMain()
1 parent 4ee90cd commit b873677

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/@ngtools/webpack/src/plugin.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,14 @@ export class AotPlugin implements Tapable {
167167

168168
if (options.entryModule) {
169169
this._entryModule = options.entryModule;
170-
} else {
171-
if (options.mainPath) {
172-
this._entryModule = resolveEntryModuleFromMain(options.mainPath, this._compilerHost,
173-
this._program);
174-
} else {
175-
this._entryModule = (tsConfig.raw['angularCompilerOptions'] as any).entryModule;
176-
}
170+
} else if (this._angularCompilerOptions.entryModule) {
171+
this._entryModule = path.resolve(this._basePath, this._angularCompilerOptions.entryModule);
172+
}
173+
174+
// still no _entryModule? => try to resolve from mainPath
175+
if (!this._entryModule && options.mainPath) {
176+
this._entryModule = resolveEntryModuleFromMain(options.mainPath, this._compilerHost,
177+
this._program);
177178
}
178179

179180
if (options.hasOwnProperty('i18nFile')) {

0 commit comments

Comments
 (0)