I built an Angular 6 app consisting of a library containing components that should be reused in the future and an app. I created everything using angular cli, so I have the default structure
my-app
|
+-projects
| |
| +-my-lib
| |
| +-src
| +-package.json
|
+-src
+-package.json
To build the project, I first build the library using ng build my-lib --prod and then build the app using ng build --prod. Afterwards the dist directory looks like this
dist
|
+-my-app
+-my-lib
My question is now how to deploy this to my server, so that the app has access to the library. Locally everything works, so should I just transfer the whole dist directory to my server as usual?
Or should I publish the library to npm and add it as a regular dependency to my package.json.
And if yes, how do I set this up to not interfere with local development, where I want to build against the library in the dist directory?