Some questions about the building process (webpack and cordova)
-
I use a Windows machine to build cordova for android, and a virtual machine with MacOS to build for ios. The folder ‘src-cordova’ is created automatically when I do ‘quasar build -m cordova -T android’. Then I add some cordova plugins and do the final build.
For some plugins I also need to do some adjustments in config.xml to get everything right. Is manually adjusting config.xml even a good idea or could this be done in an other way?Then I need to build the app for ios. I don’t really like the idea of having to do all the work (plugins and config.xml) on MacOS again. How is this supposed to work? Putting the entire ‘src-cordova’ folder into a version control system seems like a bad idea, when only config.xml really matters. I guess I’m not the only one that is using multiple machines (or developers) to build apps?
Further, I like the idea (for beginners) of using just quasar to all the building stuff, but at some point you want to be able to do extra things in webpack and cordova. Is this supported or are we supposed to use only quasar ?
-
Hi,
- Yes, you can safely edit config.xml. You can safely edit anything inside of src-cordova. It’s just a Cordova project folder that will be used to generate the mobile app. Quasar CLI takes care of filling it with your src content.
- You may notice a .gitignore file. This one tells GIT to also ignore folders/files form src-cordova that are of no importance to GIT (and should not be added to version control assets), like: /src-cordova/platforms, /src-cordova/plugins, /src-cordova/www. This is out of the box. So yes, safely add src-cordova to GIT as it will ignore what it shouldn’t be there.
- Then, on another machine, you can use same repo. Just run “cordova prepare” from /src-cordova, and it should install all Cordova plugins etc etc. Cordova also uses a package.json to tell this command what to do to initialize.
Finally, if you want to tweak the Webpack config, there’s quasar.conf.js > build > extendWebpack(cfg). The docs have all necessary info.
-
Ok thank you. I’m using SVN for version control though, so I’ll include the src-cordova folder, but put an ignore on ‘platforms’,‘plugins’ and ‘www’ (and ‘node_modules’)
-
Unfortunately I don’t really understand how extendWebpack works. Could this also be used to copy resources to a folder in src-cordova/www using shelljs ? In another (non-Quasar) project I did this in the webpack build script with :
var shell = require(‘shelljs’);
shell.mkdir(’-p’, ‘cordova/www/images’);
shell.cp(’-R’, ‘images/’, ‘cordova/www/images’); -
If you need to manually copy images to src-cordova, it means you’re doing it all wrong. Take a look here please, a link for how to handle assets (images, etc) - there’s statics and webpack assets: http://quasar-framework.org/guide/app-handling-assets.html
-
This post is deleted!