11 Jan, 2023
1 min read
I recently had to use a library, but I had a few modifications of my own to satisfy my use case. Found out it is possible to have a local derivative of that library and use it in your project, instead of the published library package.
You can do this in just a few steps!
yarn install
After the package has been installed, you can make your desired changes.( Be advised to follow the documentation and guidelines of the package when making changes)
yarn build
yarn link
This would generate a link, for example, @rawgraphs/echarts
.
Go to the project you would like to use the modified library/package for and run "yarn link [generated link]" as so
yarn link @rawgraphs/echarts
You can now go to your package.json file to confirm the presence of the link in your list of dependencies.
Subsequently, anytime you make changes in the library, you would have to run yarn build for it to reflect in your project.
Cheers!
Feel free to reach out to me if you're looking for a developer, have a query, or simply want to connect.