2024-07-23


Stubbing and linking packages for easier development
When using packages from (in particular) the Vue ecosystem it is likely that they use unbuild. Sometimes you can see in the package.json something like "dev": "unbuild --stub".
You can run this to build the package in stub mode which basically allows it to run using jiti. This allows you to edit your code and not have to rebuild and also doesn’t need you to run any watch process either.
You can then link the package to test it in an actual project. The syntax differs a bit depending on the package manager you use. For npm it’s npm link in the source package and npm link <packagename> in the consuming project. For bun it’s bun link in the source package and you get some instructions in the console.
Go back to all posts