Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ngtools/webpack v.1.2.6 - not building lazy routes #4346

Closed
unsafecode opened this issue Feb 2, 2017 · 7 comments
Closed

@ngtools/webpack v.1.2.6 - not building lazy routes #4346

unsafecode opened this issue Feb 2, 2017 · 7 comments

Comments

@unsafecode
Copy link

Please provide us with the following information:

OS?

Windows 10

Versions.

[email protected]
[email protected]

@ngtools/[email protected]
[email protected]
[email protected]
not an angular-cli project

Repro steps.

After upgrading from v1.2.3 to v1.2.6, all the lazy routes chunks are missing from output. With v1.2.3, they were all included in the main bundle - which was still a mistake, but more manageable.

The log given by the failure.

No actual failure: other chunks are simply missing in output.

Mention any other details that might be useful.

app.routes.ts format:

export const ROUTES: Routes = [
{path: 'lazy', loadChildren: './lazy.module#LazyModule'},
{path: '', component: HomeView}
]
@born2net
Copy link

born2net commented Feb 2, 2017

yes we see the same issue in latest .28-3

@unsafecode
Copy link
Author

@born2net AFAIK, I was able to fix this by changing the configuration of CommonChunksPlugin, which I originally copied from angular2-webpack-starter, this way:

		new CommonsChunkPlugin({
			name: 'polyfills',
			chunks: ['polyfills']
		}),
		// This enables tree shaking of the vendor modules
		new CommonsChunkPlugin({
			name: 'vendor',
			chunks: ['main'],
			minChunks: module => /node_modules/.test(module.resource)
		}),
		// Specify the correct order the scripts will be injected in
		new CommonsChunkPlugin({
			name: ['polyfills', 'vendor'].reverse()
		}),

and by expliciting writing a vendor.bundle file.

@coryrylan
Copy link
Contributor

Seeing the same here

@born2net
Copy link

born2net commented Feb 3, 2017

@unsafecode I am using cli so can't access webpack config
and same issue with .30 as well
if I install ng-tools 1.2.6 manually chunks will be created BUT re-builds do not work
using Win 10 64 bit

@filipesilva
Copy link
Contributor

To the best of my knowledge, this does not happen on the latest release (1.2.12).

If you are still experiencing this please open a new issue with a simple repro we can follow. We test the lazy route generation on our test suites, so if it's broken we really need a simple repro to investigate the particulars of your scenario.

@JohnGalt1717
Copy link

#4431 is still an issue that's related to this.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants