Skip to content

Commit 27a034d

Browse files
authored
fix(@ngtools/webpack): fixed relative path for AoT. (#3114)
Re-enabled test for all. Also added the baseUrl option as it makes most sense.
1 parent ed0fd3e commit 27a034d

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

packages/angular-cli/blueprints/ng2/files/__path__/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compilerOptions": {
3+
"baseUrl": "",
34
"declaration": false,
45
"emitDecoratorMetadata": true,
56
"experimentalDecorators": true,

packages/webpack/src/plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export class AotPlugin {
282282
.map(route => {
283283
const mr = ModuleRoute.fromString(route);
284284
const relativePath = this._resolveModulePath(mr, relativeModulePath);
285-
const absolutePath = path.join(this.genDir, relativePath);
285+
const absolutePath = path.resolve(this.genDir, relativePath);
286286
return {
287287
moduleRoute: mr,
288288
moduleRelativePath: relativePath,

tests/e2e/tests/misc/lazy-module.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,14 @@ import {addImportToModule} from '../../utils/ast';
66

77

88
export default function(argv: any) {
9-
/** This test is disabled when not on nightly. */
10-
if (!argv.nightly) {
11-
return Promise.resolve();
12-
}
13-
149
let oldNumberOfFiles = 0;
1510
return Promise.resolve()
1611
.then(() => ng('build'))
1712
.then(() => oldNumberOfFiles = readdirSync('dist').length)
1813
.then(() => ng('generate', 'module', 'lazy', '--routing'))
1914
.then(() => addImportToModule('src/app/app.module.ts', oneLine`
20-
RouterModule.forRoot([{ path: "lazy", loadChildren: "app/lazy/lazy.module#LazyModule" }])
15+
RouterModule.forRoot([{ path: "lazy", loadChildren: "app/lazy/lazy.module#LazyModule" }]),
16+
RouterModule.forRoot([{ path: "lazy1", loadChildren: "./lazy/lazy.module#LazyModule" }])
2117
`, '@angular/router'))
2218
.then(() => ng('build'))
2319
.then(() => readdirSync('dist').length)

0 commit comments

Comments
 (0)