Angular-cli: deployUrl doest work for lazy loaded modules

Created on 25 Mar 2017  路  4Comments  路  Source: angular/angular-cli

- [x] bug report
- [ ] feature request

Versions.

@angular/cli: 1.0.0
node: 7.5.0
os: darwin x64
@angular/animations: 4.0.0
@angular/common: 4.0.0
@angular/compiler: 4.0.0
@angular/compiler-cli: 4.0.0
@angular/core: 4.0.0
@angular/flex-layout: 2.0.0-rc.1
@angular/forms: 4.0.0
@angular/http: 4.0.0
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.0
@angular/platform-browser-dynamic: 4.0.0
@angular/platform-server: 4.0.0
@angular/router: 4.0.0
@angular/cli: 1.0.0

Repro steps.

from .angular-cli.json

"outDir": "../../public/assets",
"deployUrl": "./assets",

somewhere in the routing module:

{path: 'home', loadChildren: './home/home.module#HomeModule'}

So my initially loaded sources are available as http://localhost:4200/assets/main.bundle.js (it works well)

Desired functionality.

I want all lazy loaded modules to be available as http://localhost:4200/assets/assets1.chunk.js, but now they are loaded as http://localhost:4200/assets1.chunk.js (it misses /assets/ folding)

Most helpful comment

You need a trailing / on deployUrl.

All 4 comments

found temporary workaround, but it is eager loading:

import { HomeModule } from './home/home.module';

{path: 'home', loadChildren: () => HomeModule}

You need a trailing / on deployUrl.

Thank you! It works

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings