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

Make the webpack dependencies prod dependencies of this plugin #569

Closed
@sis0k0

Description

@sis0k0

Issue Checklist

  • You are submitting: a feature request

Current behaviour

Currently, when installing the nativescript-dev-webpack plugin, some development dependencies are added to the package.json of the project. These dependencies are needed for the webpack build.

Problems

  1. It's hard to upgrade to newer {N}-dev-webpack versions that require different dependencies. You have to manually invoke ./node_modules/.bin/update-ns-webpack --deps. This is a very annoying thing to do for all {N} apps and plugins in the {N} organisation.
  2. The dependencies list in the project's package.json gets huge and it's often hard to recognize which are the webpack dependencies.
  3. 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 - https://github.com/angular/angular-cli/blob/master/packages/ngtools/webpack/src/loader.ts#L36-L43.

Proposed solution

Solution for 1. and 2. - all dependencies that are currently added to the project's package.json, will be dependencies of the nativescript-dev-webpack plugin. They won't be added to the project's package.json anymore.
Solution for 3. - all {N} Angular projects and templates should have a dependency to @angular-devkit/build-angular. That way, the {N}-dev-webpack plugin won't have to have a dependency to @ngtools/webpack, because the above is already brought to the project by @angular-devkit/build-angular.

Tasks breakdown

  1. Make all packages from the dependencyManager dependencies of the nativescript-dev-webpack plugin.
  2. Make the update-ns-webpack script remove all unneeded dependencies from the project.
  3. Make the update-ns-webpack script update or add if missing the @angular-devkit/build-angular and @angular/compiler-cli dependencies.
  4. Update all {N} apps in the {N} organization by removing their webpack dependencies.
  5. Add @angular-devkit/build-angular as dependency to all apps and templates in the {N} organization.
  6. Update @nativescript/schematics - remove the adding of webpack dependencies there.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions