DaveSav
DaveSav

Reputation: 1374

Cordova updates are resetting project

Every time I

To an existing app using node e.g.

cordova plugin add [some-plugin]
cordova platform update ios
etc

The update/add process always resets my [platform]/www/ folder to an empty project. I always take a backup before doing this, and put the www files back in. But there is always a conflict, or missed or forgotten files, which just increases the time to update.

This can't be right. Surely the Cordova update process can't really involve wiping out your existing project and starting again.

What am I doing wrong?

Upvotes: 0

Views: 513

Answers (1)

Connor
Connor

Reputation: 64644

With a regular Cordova workflow you shouldn't be making any changes within the platforms directory. The platforms and plugins folders should be considered build artifacts and not checked in to source control. Cordova will automatically recreate them when needed.

When you run cordova prepare it will install all of the plugins you have listed in config.xml and copy the content of your root www folder to the platform www folder.

Upvotes: 2

Related Questions