-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the contentful-gatsby-components wiki!
For linking this project as a local dependency
We need to be able to make modifications to this library while it is being used in the main Gatsby/CMS repos. You would typically do this with yarn link
, however it has proven to be problematic. https://github.com/dadoagency/contentful-gatsby-components/issues/6
We are now experimenting with yalc
to link the project.
npm: https://www.npmjs.com/package/yalc
GitHub: https://github.com/whitecolor/yalc
Install yalc
.
Using NPM:
npm i yalc -g
Using Yarn:
yarn global add yalc
Add this project as your published local dependency.
Run the following of the root folder of this project, not the Gatsby/CMS repo.
yalc publish
Link the this project locally.
In your Gatsby/CMS root folder, run:
yalc link @dadoagency/contentful-gatsby-components
You need to run a command(s) for the changes to reflect.
You can either do this manually or use a watch mode we have setup.
- Run
yalc publish
in the dependency repo after you've made changes. - Run
yalc update
in the Gatsby/CMS repo.
Alternatively, you can simply:
- Run
yalc push
in the dependency repo after you've made changes.
- Run
yarn run watch-yalc
(This will run:nodemon -x 'yalc push --changed'
)