Tom
Tom

Reputation: 6004

Structure of codebase to build for multiple platforms from one codebase in VuetifyJS/VueJS

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?

Upvotes: 3

Views: 290

Answers (1)

Odyssee
Odyssee

Reputation: 2463

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.

Upvotes: 3

Related Questions