3

I would like to use the VuetifyJS/VueJS templates to build a Web app (PWA), Android app (Cordova) and Desktop app (Electron) from one codebase. What is the best way to structure the main codebase to easily create the built for each platform?

Tom
  • 5,588
  • 20
  • 77
  • 129

1 Answers1

3

Well, if you use Cordova you should place your build files in the dist folder, as you are used to. Then I do the following:

After Installing Cordova initialize in your project

cordova create mobile com.f1lt3r."${PWD##*/}"
cd mobile

Lets add the Android platform

cordova platform add android

This creates a mobile folder with the Cordova project in it. Next, create a symbolic link from your project build files to the Cordova web root.

cd ..
rm -rf mobile/www/*
ln -s $(pwd)/dist/* $(pwd)/mobile/www

Now, for Electron you could take a look at the config files of SimulatedGREG/electron-vue, I am not too familiar with this, but I think it would be possible to do something similar as with Cordova.

Odyssee
  • 2,393
  • 2
  • 19
  • 38