Transcript
00:00 So whenever you release a new package, you want to make sure it's being pre-built first. So if you look here in our packages folder, we see all the packages when we run the build script are being built inside here. So there's this folder. So basically if I run nx run many-t build, you will see it builds all these different packages.
00:18 And so this folder will appear in here. Now in the product right now, we're using this custom script here to release, which will copy everything into our build folder and then release it from there. So we want to make sure that all the products are being pre-built beforehand. And so to do that, you have different options.
00:36 First of all, if you don't use a custom release script as we do, there is a pre-version command. So you can here have a pre-version command where you can set it basically to the command that we just ran and say, I want to run the build beforehand. And so whenever the version starts before it actually applies, the version will run the build, then version it and run the publishing and everything else.
00:55 Now in our case, that is also too late because in our release script, what we do is basically we copy everything from that packages folder over to this custom build folder. And then we run a version on top of that. However, the build, which will also be specified in pre-version command, still happens on the package down here. And so we are missing out on that.
01:13 So basically in our case, we need to run it beforehand. Now we could either run the actual nx run many-t build in here, or we could also just go to the package.json and combine it in here. So basically run something like npm run all, or just in this case, for sake of simplicity,
01:30 have something like nx run many-t run build. And then it invokes our release script. And so with that, if you run here the release script, it would first run the build. In this case, it is even cached because nx caches it. And so here we now get actual dist output as well, which would then be included in the
01:48 actual package that is being published.