Say you have two different Angular 2 apps and both of them need to make use of the same component.
I created the common component, made a library following this tutorial http://blog.angular-university.io/how-to-create-an-angular-2-library-and-how-to-consume-it-jspm-vs-webpack/, but npm will make my code public and I will have to pay to make it private.
So, the questions are:
Thanks in advance.
Only one root module can exist in an Angular application.
The node modules folder is the default folder where all 3rd-party libraries are installed, according to which our application runs. This is used for development purposes. When we run or build our project then only required libraries are put together in a bundle and then deploy into the server.
package.json allows you to reference packages downloaded from a git repository, and this could be the one you use internally. See NPM documentation
Example of formats:
git+ssh://[email protected]:npm/npm.git#v1.0.27
git+ssh://[email protected]:npm/npm#semver:^5.0
git+https://[email protected]/npm/npm.git
git://github.com/npm/npm.git#v1.0.27
So this would in your package.json give something like:
"dependencies": {
"privatepackage":"git://localgitserver/git/privatepackage.git"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With