Skip to content

Commit

Permalink
fix(@ngtools/webpack): fixed relative path for AoT. (#3114)
Browse files Browse the repository at this point in the history
Re-enabled test for all. Also added the baseUrl option as it makes most sense.
  • Loading branch information
hansl committed Nov 12, 2016
1 parent ed0fd3e commit 27a034d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export class AotPlugin {
.map(route => {
const mr = ModuleRoute.fromString(route);
const relativePath = this._resolveModulePath(mr, relativeModulePath);
const absolutePath = path.join(this.genDir, relativePath);
const absolutePath = path.resolve(this.genDir, relativePath);
return {
moduleRoute: mr,
moduleRelativePath: relativePath,
Expand Down
8 changes: 2 additions & 6 deletions tests/e2e/tests/misc/lazy-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ import {addImportToModule} from '../../utils/ast';


export default function(argv: any) {
/** This test is disabled when not on nightly. */
if (!argv.nightly) {
return Promise.resolve();
}

let oldNumberOfFiles = 0;
return Promise.resolve()
.then(() => ng('build'))
.then(() => oldNumberOfFiles = readdirSync('dist').length)
.then(() => ng('generate', 'module', 'lazy', '--routing'))
.then(() => addImportToModule('src/app/app.module.ts', oneLine`
RouterModule.forRoot([{ path: "lazy", loadChildren: "app/lazy/lazy.module#LazyModule" }])
RouterModule.forRoot([{ path: "lazy", loadChildren: "app/lazy/lazy.module#LazyModule" }]),
RouterModule.forRoot([{ path: "lazy1", loadChildren: "./lazy/lazy.module#LazyModule" }])
`, '@angular/router'))
.then(() => ng('build'))
.then(() => readdirSync('dist').length)
Expand Down

0 comments on commit 27a034d

Please sign in to comment.