node.js - npm local modules vs prod -


we developping 2 modules depending on one. a -› b , c -› b

i dug solutions available now:

from projects a, b npm link ../projectc

  • cool:
    • it's symlink, changing file in c passed on , b
  • not cool:
    • it requires ../projectc in parent folder (no npm install on prod)
    • it not show in package.json
    • so need fiddle postinstall in package.json

or npm install ../projectc

  • cool:
    • it's in package.json
  • not cool:
    • it requires ../projectc in parent folder (no npm install on prod)
    • we have npm install everytime change c

so solution npm link.

  1. you can, in project c npm link (make sure have package.json).

  2. then in projects , b:

    • npm link module-projectc
    • also add dependency in package.json
  3. then able code comfortably while in development, , npm install in production scenarios.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -