How to use a forked addon


#1

Hi!, i want to use a ember addon but with some changes mines. I don’t know if the addon manteiner will merge my pull request (i hope that he will do soon) but in the meantime, i can use my addon fork in a ember-cli project? is it possible?

thanks!


#2

yes,

npm install <repository-url> --save-dev

the <repository-url> can be a github url, or a local directory on your machine…


#3

Thanks @Loz, that works great !


#4

If you’re looking to move to Yarn Package Manager in the future, make sure to include a commit in the url. Your package.json should have an entry that looks like:

"packageName": "git+https://github.com/user/repo.git#commitHash",

This is probably a good idea anyway, as it makes sure you (or a colleague) won’t get any surprise updates.


#5

Also, if you are working on the add-on simultaneously with the consuming app, you can use nom link from the add-on directory, and then nom link to use the local working directory for the add-on in your app. If you do this there is a flag in the ember app you can configure to cause it to reload the UI on add-on changes.

https://ember-cli.com/extending/#link-to-addon-while-developing