Npm package.json inheritance

吃可爱长大的小学妹 提交于 2020-03-18 03:44:22

问题


Is there a mechanism in npm like parent pom in Maven. The goal is to have a common base configuration for scripts, dependencies, devDependencies. Not based on templates like yeoman or so, but based on a parent version. So that, any project that changes his parent version gets the changes in this parent automatically.

Can you point me to hints to achieve this?

Thanks!


回答1:


Currently there is no built-in npm mechanism to achieve this, and there's not likely to be one in the future.

See the discussion here and this comment particularly.




回答2:


We built https://github.com/Cosium/dry-dry.
Its only purpose is to add package.json inheritance capability.
It delegates all commands to npm.

The documentation is still in early stage, but it works.



来源:https://stackoverflow.com/questions/42441543/npm-package-json-inheritance

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!