nix-community / yarn2nix

Generate nix expressions from a yarn.lock file [maintainer=???]
GNU General Public License v3.0
123 stars 61 forks source link

How do I properly install software built with react-scripts build #112

Open pmiddend opened 5 years ago

pmiddend commented 5 years ago

I'm building my software using react-scripts build which creates a build/ directory below the current working directory. So, in mkYarnPackage, I added a buildPhase that calls react-scripts build and an installPhase that tries to cp build/ $out. However, the install phase doesn't seem to find build, although it's clearly created. What am I doing wrong? On my local machine, referring to it via /build/${name}/deps/${name}/build works, but it doesn't on my CI server.

hydn10 commented 5 years ago

Can you try using pname instead of name?

You can also try to use something like installPhase = "ls -lh"; to check how the directoyr structure ends up after the build (if you can see the build output).

Hope this helps.