Skip to content

Commit

Permalink
Initial setup for vite pwa module
Browse files Browse the repository at this point in the history
  • Loading branch information
DepkaCZ committed May 29, 2024
1 parent b2bfe7e commit d8eec09
Show file tree
Hide file tree
Showing 9 changed files with 16,839 additions and 1 deletion.
10 changes: 10 additions & 0 deletions playground/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template>
<ion-app>
<NuxtPwaManifest />
<ion-router-outlet />
</ion-app>
</template>

<script setup>
import { IonApp, IonRouterOutlet } from '@ionic/vue'
</script>
37 changes: 36 additions & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const sw = process.env.SW === 'true'

export default defineNuxtConfig({
modules: ['@nuxtjs/ionic'],
modules: ['@nuxtjs/ionic', "@vite-pwa/nuxt"],
css: ['~/assets/css/ionic.css'],
ionic: {
// integrations: {
Expand All @@ -14,4 +16,37 @@ export default defineNuxtConfig({
// utilities: false,
// },
},
pwa: {
strategies: sw ? 'injectManifest' : 'generateSW',
srcDir: sw ? 'service-worker' : undefined,
filename: sw ? 'sw.ts' : undefined,
registerType: 'autoUpdate',
manifest: {
name: 'Nuxt Ionic PWA example app',
short_name: 'NuxtIonicPWAExampleApp',
theme_color: '#ffffff',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable',
},
],
},
devOptions: {
enabled: true,
type: 'module',
},
}
})
Loading

0 comments on commit d8eec09

Please sign in to comment.