nixpkgs/pkgs/build-support/node
adisbladis 9c7ff7277c
importNpmLock.buildNodeModules: init
`importNpmLock.buildNodeModules` returns a derivation with a pre-built `node_modules` directory, as imported by `importNpmLock`.
This is to be used together with `importNpmLock.hooks.linkNodeModulesHook` to facilitate `nix-shell`/`nix develop` based development workflows:

```nix
pkgs.mkShell {
  packages = [
    importNpmLock.hooks.linkNodeModulesHook
    nodejs
  ];

  npmDeps = importNpmLock.buildNodeModules {
    npmRoot = ./.;
    inherit nodejs;
  };
}
```
will create a development shell where a `node_modules` directory is created & packages symlinked to the Nix store when activated.

This code is adapted from https://github.com/adisbladis/buildNodeModules
2024-08-29 06:12:07 -07:00
..
build-npm-package tree-wide: use top-level cctools 2024-07-17 22:36:19 -04:00
fetch-npm-deps fetch-npm-deps: be less noisy 2024-08-09 15:08:33 -04:00
fetch-yarn-deps yarnConfigHook: apply as a postConfigure hook 2024-08-28 23:30:55 -04:00
import-npm-lock importNpmLock.buildNodeModules: init 2024-08-29 06:12:07 -07:00