feat: Skip copying cordova files to project if cordova is not used
Feature Request
Description
When running npx cap sync, capacitor copies cordova related files into the web assets folder even if my project does not use cordova at all. It should not copy the files to the web assets folder, since this increases unessecary file size.
Platform(s)
All
Preferred Solution
If the cordova field is omitted from capacitor.config.js, capacitor should skip copying cordova related files (cordova.js, cordova_plugins.js, native-bridge.js) to the web assets folder.
If there are no Cordova plugins the cordova.js and cordova_plugins.js files are copied but they are empty, so the size increase is minimal. native-bridge.js is a capacitor file, not a cordova file.
They should not be copied at all. If native-bridge.js is a part of capacitor, why isn't it a part of @capacitor/core? That way it can minified more easily as the rest of the js.
Also why are assets like capacitor-cordova-android-plugins even there when there is no cordova related stuff. Granted I don't know how much these files affect the total filesize of the application, but it seems to me on a fundamental level that these should be only included if there are any cordova related plugins found in the project.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.