This is more a Cordova question, but specific to Ionic as it also helps us to manage our plugins:
Is there a way to pin Cordova plugins to a specific version?
Cordova released quite a lot of updated plugins a few days ago which is quite nice, but a desaster for me as I am just in the middle of a release process, building apps for the stores. And a
/platform are not in git (and have to be rebuilt because of package name changes) I have to download the plugin source again… UAHHH!
Ok, got answers on Slack.
Yes, you can do that. Just use the current version when you install the plugin (
ionic plugin add email@example.com) and you should be fine.
I tried all the different versions of parameters that you can use, here they are and their results:
ionic plugin add phonegap-plugin-push installs the current version of the plugin and adds the plugin name to
ionic plugin add com.adjust.sdk --save installs the current version of the plugin, adds the plugin name to
package.json and the plugin name and current version to
<plugin name="com.adjust.sdk" spec="~4.1.3" />
ionic plugin add firstname.lastname@example.org installs the 1.0.0 version of the plugin and adds the plugin name and version to
ionic plugin add email@example.com --save installs the 1.0.0 version of the plugin, adds the plugin name and version to
package.json and the plugin name and specified version to
<plugin name="cordova-plugin-file" spec="~3.0.0" />
What seems missing is a command that does for
--save does for Cordova: Pin the current version on install time. Or did I miss it?
Luckily I can fix my current issues by getting the currently installed and last working (and saved to git) version of the plugins, add them to package.json and
ionic state restore will work again as intended.