Skip to content

Commit 3f3e247

Browse files
committed
feat: install capacitor packages by default
1 parent 3d8e84a commit 3f3e247

File tree

6 files changed

+622
-182
lines changed

6 files changed

+622
-182
lines changed

docs/content/2.getting-started.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ You're good to go!
4141
The first time you start a Nuxt project with `nuxt-ionic` enabled, a `ionic.config.json` file will be created if it doesn't already exist.
4242
::
4343

44+
## Enabling Capacitor
45+
46+
[Capacitor](https://capacitorjs.com/) is a powerful tool for shipping to native platforms like iOS and Android alongside your web app.
47+
48+
The good news is that it's installed by default with `nuxt-ionic`, but you will need to enable it and choose what platforms you want to support.
49+
50+
```bash
51+
npx @ionic/cli integrations enable capacitor # or yarn ionic integrations add capacitor
52+
npx cap add ios # or yarn cap add ios
53+
npx cap add android # or yarn cap add android
54+
```
55+
56+
::alert
57+
After building your Nuxt app with `nuxt generate`, you will need to run `npx cap sync` to update your Capacitor project directories with your latest app build.
58+
::
59+
60+
Find out more about how to use Capacitor with Ionic at https://capacitorjs.com/docs/getting-started/with-ionic.
61+
4462
## Options
4563

4664
While not required, you can configure the features that are enabled:

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
"postpublish": "pinst --enable"
5454
},
5555
"dependencies": {
56+
"@capacitor/cli": "^3.6.0",
57+
"@capacitor/core": "^3.6.0",
5658
"@ionic/cli": "^6.20.0",
5759
"@ionic/vue": "^6.1.10",
5860
"@ionic/vue-router": "^6.1.10",

playground/capacitor.config.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

playground/capacitor.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { CapacitorConfig } from '@capacitor/cli'
2+
3+
const config: CapacitorConfig = {
4+
appId: 'io.ionic.starter',
5+
appName: 'nuxt-ionic-playground',
6+
webDir: 'dist',
7+
bundledWebRuntime: false,
8+
}
9+
10+
export default config

playground/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
},
1010
"devDependencies": {
1111
"@capacitor/camera": "^1.3.1",
12-
"@capacitor/core": "3.6.0",
1312
"@capacitor/filesystem": "^1.1.0",
1413
"@capacitor/storage": "^1.2.5",
1514
"nuxt": "^3.0.0-rc.4",

0 commit comments

Comments
 (0)