capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

feat: Skip copying cordova files to project if cordova is not used

Open robinjac opened this issue 6 years ago • 3 comments

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.

robinjac avatar Oct 11 '20 10:10 robinjac

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.

jcesarmobile avatar Oct 11 '20 13:10 jcesarmobile

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.

robinjac avatar Oct 11 '20 14:10 robinjac

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.

ionitron-bot[bot] avatar Nov 11 '22 10:11 ionitron-bot[bot]