Install Ionic Fork locally

Hey there,

how can i install a cloned ionic Fork locally? I want to make some Pull Requests and test my changes first.

I struggled around with:

@ionic/angular: "file:../ionic/angular",
@ionic/core: "file.../ionic/core"

but this seems not to work.

Has anyone done this before? Any Contributer? :blush:

I have indeed done this before, but it was a long time ago against a code base far, far away, so the best I can do now is to give some things to try.

Your first ally in this battle is going to be npm link. If you can get that to work correctly, it will be by far the simplest to deal with incrementally, as your changes in the fork will be reflected immediately.

However, sometimes projects just aren’t linkable. If you hit a dead end there, the next thing I would try is to put your fork on GitHub (where it probably is anyway) and refer to it in your test project package.json using the syntax described here.

The last resort I’ve ever used is to follow the build instructions and take whereever that stuff is that gets published to npm (I forget which directory that is for Ionic, and it’s probably changed anyway since I did this) and literally dump a copy of it (I use rsync, you can do it with cpio or tar or probably even cp) into the node_modules of that test project. This method is far from optimal, as it requires manual intervention every time you change anything.

Let us know if any of this worked for you and good luck.

Thanks for your Answer! I didn’t make it work yet… Not even with the last one. The @ionic/angular Package has a dependency to @ionic/core. Even when i change this dependency to use the local, build the ionic angular and install the result from dist folder, it doesn’t work.

1 Like

Is the part you’re trying to hack on in core, angular, or both?

Core :thinking: But i think also angular in future

In the case of core, there are some suggestions in here. Haven’t found anything similar for angular, though.

Yeah i read that before my first PR. It describes how to run the tests etc, but i think not how to use a local fork for a test project :confused: