dazinator / NetPack

.Net Core library, for runtime processing of static files such as typescript, js, css etc.
13 stars 2 forks source link

Npm Dependency Install Improvments #38

Closed dazinator closed 5 years ago

dazinator commented 5 years ago

Background

NetPack knows about all the NPM package dependencies that your pipeline requires, because they are registered with NetPack as you build the pipeline. Netpack then checks to make sure that all the NPM packages are installed (on startup) and if any are missing, installs them.

This is good if you are running for the first time and you are missing npm dependencies, or if your piepline is dynamically changed at runtime (pluggable architecture etc) - as any new dependencies can be auto installed as required.

However its also desirable to be able to override this installation check. If for example you know that all the needed dpendencies are already installed (for example whilst developing) then this additional check every time you run the application is time consuming.

Need to add a configurable option to disable this check. This can then be enabled whilst in development mode or as required. It could also be disabled for production environments, if you are taking care of installing npm dependencies seperately.

dazinator commented 5 years ago

Rather than installing individual npm dependencies one at a time via npm install {dep}@{version} - package dependency requirements should be collated into a single top level package.json file and then npm install should be run from the directory containing that package.json file. This will mean only one top level npm install occurs rather than an npm install per dependency so should speed things up significantly. It also means there were be a single place where npm install can be disabled by the developer, and it allows the package.json file produced by netpack to be utilised by a seperate deployment process of desired.