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
Description
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
- 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. - The dependencies list in the project's
package.json
gets huge and it's often hard to recognize which are the webpack dependencies. - 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
- Make all packages from the
dependencyManager
dependencies of thenativescript-dev-webpack
plugin. - Make the
update-ns-webpack
script remove all unneeded dependencies from the project. - Make the
update-ns-webpack
script update or add if missing the@angular-devkit/build-angular
and@angular/compiler-cli
dependencies. - Update all {N} apps in the {N} organization by removing their webpack dependencies.
- Add
@angular-devkit/build-angular
as dependency to all apps and templates in the {N} organization. - Update
@nativescript/schematics
- remove the adding of webpack dependencies there.