ionic-frameworknpm-link

How to use npm link?


I have a module, let call it contact_us, that I have linked it to my ionic project. I could successfully link the module and see it in my app, but when I modify the contact_us module, the changes are not reflected in my project.

Here is what I've done:

  1. In the contact_us module:
 npm link
  1. In the project:
npm link contact_us
ionic cap build android

Does anyone know what I'm missing? Thanks in advance.


Solution

  • Well, I found how to update the link. In your module directory, i.e., contact_us, do:

    npm run build
    cd /dist/contact_us
    npm link
    ng build --watch
    

    Then in the you project directory:

    npm link contact_us
    ionic cap build android