Member-only story

Using The Ionic Framework with Webpack, Capacitor & Vue To Build PWAs, iOS & Android Apps

Dale Zak
6 min readApr 3, 2020

This article outlines how to use the Ionic Framework with Webpack, Capacitor and Vue, including setting up vue router, vuex, and ionicons to make your life a little easier for building PWAs, iOS and Android apps. Enjoy!

Create Vue Project

First create a vue project using the webpack-simple template.

vue init webpack-simple my-app

Setup Environment Variables

Next create .env file for your production variables.

VUE_APP_NAME=MyApp

Then create .env.dev file for your development variables.

VUE_APP_NAME=MyApp Dev

Update Webpack Package

Make sure to update to the latest webpack.

npm install webpack@latest --save-dev

Add Vue Packages

Now let’s add some vue packages.

npm install @vue/cli-service @vue/cli-plugin-babel @vue/cli-plugin-eslint vue-cli-plugin-route --save-dev

Update Package Json

Dale Zak
Dale Zak

Written by Dale Zak

Full stack developer specializing in web apps built on Rails with Stimulus, and mobile apps using Ionic and Vue.

Responses (3)

Write a response

Great Post I’m trying to do some test with ionic/vue using axios, my problem is that when I try my app from the android studio virtual device or from a actual android mobile, the http requests never reach the server. Have you any clue about what could happen?

Dear Dale
thank you very much. your article gave me a very good first insight in the combination of vue and store via a great example (user login) however I seem to can't connect the store in vue3 with the lines:
const app = createApp(App)
.use(IonicVue…

Great post!
My was trying to use that combination. But, I couldn’t show the ionic icons. Now it works according to your post.
Thanks Dale.