Hi, I realise I asked already this question quite a long time ago but I’m still struggling with F7v5 and Cordova.
One of the most useful thing for me during development of Cordova App is the command
simulate android --target=chrome
Which allows me to test very fast changes to my app in a browser (instead of having to load the app in an emulator or physical device).
With F7v5 dir structure I’m confused and I’m not sure how to use this command in a consistent manner.
If I run it in the F7 directory, of course, “simulate” complains that this is not a Cordova directory.
If I cd to cordova/ the command works but I have a “naked” Cordova project… In practive I don’t have the files available in the project root www directory.
framework7 simulate android --target=chrome
doesn’t work either
How can I work in F7-project/src/ path and see my changes reflected through simulate?
Maybe I need to execute something first to ensure the cordova/www directory gets synced with the root one?
NOTE: Reason for using simulate instead of the development server in F7 is to have (some) plugin simulated
and Abiodun answered
“I figured out the problem. I just needed to run npm run build-dev-cordova-android, before emulating”
Now… should it become (with webpack):
npm run build-dev-cordova-android && cd cordova && simulate android --target=chrome
?
I’m also not clear what will happen if I exclude webpack because I think that anyway the cordova folder will not be synced automatically but will anyway require a command
I’m wondering if I should approach the issue in an opposite way.
Basically, in my case, I’d like/need to stick to pure “cordova” as much as possible also in terms of tools (“simulate” command first of all).
Would it be a right approach to either generate all the assets, make the first build and then just work in cordova/ subdir?
Or… can I simply create a cordova project, in index.html add in
and before the end of
and then just work as usual?
Would those 2 files be enough and are the right versions for a general cordova project?
No, it is not possible as you use webpack, webpack requires build step that generates code/bundle that can run in browser.
But if you check webpack docs, it has a command (or options) to build once and then watch for changes and quickly rebuild on them, the CLI command is something like:
Hi Srbala, thanks for comment
Anyway the simulation works properly, the issue is that the code doesn’t get synced automatically into the cordova folder… that’s why I’m looking for workaround, including just using the js and css files directly for F7 withouth any automation…