This repo is to demonstrate an npm managed workspace built by dream2nix.
How do I tell dream2nix to build a local workspace package so it doesn't try and fetch it from NPM?
There is an app in apps/myapp
that has a dependency on the workspace package packages/adder
.
There is another app in apps/myapp-nodep
that does not have any dependencies.
npm install
npm run build --workspaces
Assuming you have built the app you can run the app.
node apps/myapp/dist/app.js
> Hello, World! - 3
Should print:
node apps/myapp-nodep/dist/app.js
> Hello, World!
nix run .#myapp-nodep
> Hello, World!
With a workspace dependency:
nix run .#myapp
> ...
> Not Found - GET https://registry.npmjs.org/@d2n%2fadder - Not found
> ...