Whenever I add new plugin to my cordova app, all my files in the www folder are gone and the default phonegap project files(Device is ready!) gets back.
So whenever I have to add new plugin, I have to back up my www folder and then add plugin, then paste back my code.
I install through Cordova CLI. Cordova version is 6.1.1.
I put all my files in project/platforms/ios/www.
I tried putting my files in www in the base directory as per mentioned here but it does not work. Screen is white blank on running the app.
So please suggest a solution so that when I add plugin, all my files in www folder stays. Thanks.
You are putting your files in the wrong place. The entire platforms folder should be considered a build artifact and not used in this way, nor should it be committed to source control.
In the "root" of your Cordova project (the folder that config.xml lives in), there's a www folder. You should keep your application files there. When you run:
cordova build ios
All files and folders inside www will be copied to:
platforms/ios/www
And replace any that were there before. When you run:
cordova build ios
All files and folders inside www will be copied to:
platforms/android/assets/www
See the Cordova CLI documentation for more information.