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

Ability to Disable chunk optimization for ng test command #7363

Closed
vance opened this issue Aug 11, 2017 · 12 comments
Closed

Ability to Disable chunk optimization for ng test command #7363

vance opened this issue Aug 11, 2017 · 12 comments

Comments

@vance
Copy link

vance commented Aug 11, 2017

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Desired functionality.

As a developer, I'd like to disable chunk optimization during compilation for ng test command. Current builds on a project with a few dozen components takes 36-60 seconds on this step depending on CLI version. This is bad for unit testing.

Mention any other details that might be useful.

Because of this issue #5775 AOT/chunk is really really slow and makes unit testing ghastly.

@dinvlad
Copy link

dinvlad commented Aug 16, 2017

Does ng test use AOT? I thought it was slow without it..

@Simon-Briggs
Copy link

ng test doesn't use AOT by default, but it does bundle your project, which is also quite slow.

@devoto13
Copy link
Contributor

But build is slow only for the first time. You run ng test in a watch mode. It takes 30-60 seconds to build for the first time and than you just change you code and it reruns tests (taking only couple of seconds to rebuild). Or am I missing something?

@dinvlad
Copy link

dinvlad commented Aug 17, 2017

@devoto13, on some systems it takes that long even during incremental reruns.

@vance
Copy link
Author

vance commented Aug 17, 2017

ng test --watch always does 92% chunk asset optimization EVERY TIME which goes on forever 30-60 seconds depending on CLI version. Sure, it incrementally compiles, but then it does the dreaded chunk step (which I previously believed was part of AOT). If it's not, then this feature request is to remove chunk asset optimization for ng-test

@vance vance changed the title Ability to Disable AOT for ng test command Ability to Disable chunk optimization for ng test command Aug 17, 2017
@hccampos
Copy link

The "solution" to this is to turn off the source maps. Not sure about the state of the cheaper devTool options in webpack when using Typescript (they didn't use to work well), but if they do work it would be a huge bonus.

@Svoig
Copy link

Svoig commented Aug 18, 2017

In my experience disabling source maps only marginally reduces the build time. It might save a few seconds, but when the chunk asset optimization step already goes on for a full 30 seconds, it isn't really much help.

@filipesilva
Copy link
Contributor

This isn't something we have turned on or off, it's just something that webpack always does while bundling code. Turning off sourcemaps helps but I don't know of any way to disable it, nor do I think it's possible currently in Webpack.

Newer versions of the CLI also should heavily reduce that step in ng test since they use a vendor chunk (#6160).

If someone shows me a repro where you see this behaviour I'd take a stab at diagnosing it though. Maybe there's more that can be done.

@filipesilva
Copy link
Contributor

To clarify though: AOT doesn't exist in ng test.

@vance
Copy link
Author

vance commented Oct 31, 2017 via email

@filipesilva
Copy link
Contributor

Thanks for reporting this issue. This issue was originally reported a long time ago and since then we've had many releases, one of which might have addressed this problem. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

@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 Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants