Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Cloud builds are slower since nativescript-dev-webpack v0.14.0 #595

Closed
7 tasks done
sis0k0 opened this issue Jul 3, 2018 · 0 comments · Fixed by #594
Closed
7 tasks done

Cloud builds are slower since nativescript-dev-webpack v0.14.0 #595

sis0k0 opened this issue Jul 3, 2018 · 0 comments · Fixed by #594

Comments

@sis0k0
Copy link
Contributor

sis0k0 commented Jul 3, 2018

Issue Checklist

Problem

Since the nativescript-dev-webpack plugin started adding a dependency to @angular-devkit/build-angular instead of @ngtools/webpack the cloud builds with NativeScript for Windows went from 10min to 15min. The change was introduced by #571 and is released with v0.14.0.
The installation of @angular-devkit/build-angular is slow on Windows, because this package has quite a lot of dependencies - 373 packages in total.

Solution

We'll revert the new behavior and go back to adding a dependency to @ngtools/webpack instead of @angular-devkit/build-angular.
The nativescript-dev-webpack plugin shouldn't add @ngtools/webpack if the project already have a dependency to @angular-devkit/build-angular. This will fix the third problem, described in #569:

For Angular projects one of the added dependencies is @ngtools/webpack. However, the @angular-devkit/build-angular package has a dependency to @ngtools/webpack. That means that if your project has a dependency to @angular-devkit/build-angular (as the default NG web projects do), this can lead to multiple versions of the @ngtools/webpack plugin in your project. Having multiple versions of that plugin causes the webpack compilation to fail - angular/angular-cli:packages/ngtools/webpack/src/loader.ts@master#L36-L43.

Local environment

  • Platform: Windows
  • Node version: 9.5.0
  • NativeScript CLI version: 4.1.3

Project data

  • Platform you are building the app for: Android
@sis0k0 sis0k0 self-assigned this Jul 3, 2018
sis0k0 added a commit that referenced this issue Jul 3, 2018
@angular-devkit/build-angular is not a dependency

Revert to adding @ngtools/webpack instead of
@angular-devkit/build-angular because the later is ~150mb bigger and
slows down the {N} cloud builds.
Add @ngtools/webpack to the project dependencies only if
@angular-devkit/build-angular isn't there already. That's because the
@angular-devkit/build-angular already depends on @ngtools/webpack. This will prevent the
plugin from adding multiple instances of @ngtools/webpack to the project
which would cause the build to fail.

related to #571, #569

fixes #595
sis0k0 added a commit that referenced this issue Jul 3, 2018
@angular-devkit/build-angular is not a dependency

Revert to adding @ngtools/webpack instead of
@angular-devkit/build-angular because the later is ~150mb bigger and
slows down the {N} cloud builds.
Add @ngtools/webpack to the project dependencies only if
@angular-devkit/build-angular isn't there already. That's because the
@angular-devkit/build-angular already depends on @ngtools/webpack. This will prevent the
plugin from adding multiple instances of @ngtools/webpack to the project
which would cause the build to fail.

related to #571, #569

BREAKING CHANGES

Not really a breaking change but:
It's a good idea to remove the `@angular-devkit/build-angular` from the
package.json and add `@ngtools/webpack` instead as this will speed up
the build.

fixes #595
sis0k0 added a commit that referenced this issue Jul 4, 2018
…ld-angular is not a dependency (#594)

* fix: add @ngtools/webpack to project deps only if
@angular-devkit/build-angular is not a dependency

Revert to adding @ngtools/webpack instead of
@angular-devkit/build-angular because the later is ~150mb bigger and
slows down the {N} cloud builds.
Add @ngtools/webpack to the project dependencies only if
@angular-devkit/build-angular isn't there already. That's because the
@angular-devkit/build-angular already depends on @ngtools/webpack. This will prevent the
plugin from adding multiple instances of @ngtools/webpack to the project
which would cause the build to fail.

related to #571, #569

BREAKING CHANGES

Not really a breaking change but:
It's a good idea to remove the `@angular-devkit/build-angular` from the
package.json and add `@ngtools/webpack` instead as this will speed up
the build.

fixes #595

* test(e2e): update demo Angular deps
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant