ng packagr does not remove devDependencies
See original GitHub issueType of Issue
[ X ] Bug Report
[ ] Feature Request
Description
ng-packagr 4.0.1
A bug: please describe the error that you encountered
-
ng-packagr copies devDependencies to the final package.json even though they are not whitelisted.
-
i have angular in peerDependencies and devDependencies
-
as a consequence i get an invalid “package” (i.e. npm link will install all those dependencies…)
-
building an app with a linked library will not work
-
the following error happens, because angular core is now referenced twice
ERROR in ../@foo/bar/foo-bar.ts(9,2): Error during template compile of 'FoobarModule'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'NgModule'
'NgModule' calls 'ɵmakeDecorator'.
node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.
node_modules/@foo/bar/node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.
Expected Behaviour
A bug: please describe what behaviour or result you expected
- devDependencies should not be copied by default and only when they are whitelisted
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 4.0.1
@angular/*: 6.1.0
typescript: 2.7.2
rxjs: 6.2.2
node: 8.11.3
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Remove dependency completely from Npm - Stack Overflow
So if you would like to remove dependencies this is where you start. remove them from package.json and run npm prune .
Read more >ng-packagr/ng-package.schema.json - UNPKG
The CDN for ng-packagr. ... ng-packagr/ng-package.schema.json ... list of dependencies that are allowed in the 'dependencies' and 'devDependencies' section ...
Read more >ng-packagr - npm
Start using ng-packagr in your project by running `npm i ng-packagr`. There are 386 other projects in the npm registry using ng-packagr.
Read more >Heroku Node.js Support
If you're not using npm install , you can go ahead and disable the ... If you need access to packages declared under...
Read more >How to clean up node modules? | by Mario Kandut - Medium
Extraneous packages are those present in the node_modules folder, but not listed as any ... the packages specified in your devDependencies will be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alan-agius4 independent of the discussion how
npm link
works, is there any usecase for includingdevDependencies
in a package published to npm?If not, I would second the request to remove
devDependencies
from the generatedpackage.json
, automatically (just asscripts
are removed)Closing as this is not planned.