nix-community / napalm

Support for building npm packages in Nix and lightweight npm registry [maintainer=?]
MIT License
104 stars 18 forks source link

node_modules get rebuilt with the main derivation #8

Open zimbatm opened 4 years ago

zimbatm commented 4 years ago

Whenever the source changes, the node_modules get rebuilt. For development this can add quite a lot to the iteration time.

What would you think of building the node_modules in a separate derivation and then symlinking it into the main derivation during build? We are doing something similar in yarn2nix.

nmattia commented 4 years ago

very good point! I haven't used napalm for local development (I npm build) but I understand this can be an issue.

zimbatm commented 4 years ago

For local development, there could also be a mode where node_modules gets symlinked into the current folder when the shellHook get executed. That way the user has the exact same dependencies and can also fetch them from binary cache.