Skip to content

Commit 803e844

Browse files
committed
Implement @vite-pwa/nuxt
1 parent d1cf9b3 commit 803e844

14 files changed

+64
-61
lines changed

.github/workflows/preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
workflow_dispatch:
55
env:
66
NODE_OPTIONS: --max-old-space-size=4096
7+
NUXT_PUBLIC_APP_NAME: Octo (Preview)
78
NUXT_PUBLIC_CDN_URL: ${{ secrets.VITE_APP_CDN_URL }}
89
NUXT_PUBLIC_DISCORD_INVITE_LINK: ${{ secrets.VITE_DISCORD_INVITE_LINK }}
910
NUXT_PUBLIC_FATHOM_EVENT_ACCOUNT_REGISTRATION: ${{ secrets.VUE_APP_FATHOM_GOAL_ACCOUNT_REGISTRATION }}
@@ -26,7 +27,6 @@ env:
2627
NUXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.VUE_APP_FIREBASE_PROJECT_ID }}
2728
NUXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.VUE_APP_FIREBASE_STORAGE_BUCKET }}
2829
NUXT_PUBLIC_STRIPE_MONTHLY_PRICE: ${{ secrets.VUE_APP_STRIPE_MONTHLY_PRICE }}
29-
OCTO_NAME: Octo (Preview)
3030
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
3131
jobs:
3232
deploy_vercel:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
.output
1717
.vercel
1818
.vscode
19+
dev-dist
1920
dist
2021
node_modules
2122
test/cypress/downloads
Binary file not shown.
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
The ultimate open source tool for personal knowledge management. Sign up at [octo.app](https://octo.app).
77

8-
[![screenshot](public/img/screenshot.png)](https://octo.app)
8+
[![screenshot](assets/screenshot.png)](https://octo.app)
99

1010
## Features
1111

app.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<div id="app" class="h-full" :class="sizes.concat([!ligatures && 'ligatures-none'])">
3+
<VitePwaManifest />
34
<AsyncChangeLog v-if="showChangeLog && !flow" />
45
<AppLayout>
56
<AppPage :pageKey="pageKey" class="bg-opacity-25 flex-grow flex-shrink h-full overflow-x-hidden relative" />
@@ -16,6 +17,7 @@ export default defineComponent({
1617
inject: ['mq'],
1718
setup() {
1819
const { public: { appName, appTitle } } = useConfig()
20+
1921
useRoot()
2022
useHead({
2123
title: appTitle,
File renamed without changes.

nuxt.config.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineNuxtConfig } from 'nuxt/config'
22
import { resolve } from 'path'
3+
import { config as pwaConfig } from './pwa.config'
34

45
const fathomScript = process.env.NUXT_PUBLIC_FATHOM_SITE_URL ? {
56
'data-auto': false,
@@ -23,7 +24,6 @@ export default defineNuxtConfig({
2324
lang: 'en',
2425
},
2526
link: [
26-
{ href: '/manifest.webmanifest', rel: 'manifest' },
2727
{ href: '/img/icons/favicon.ico', rel: 'icon' },
2828
{ href: 'https://fonts.googleapis.com', rel: 'preconnect' },
2929
{ crossorigin: '', href: 'https://fonts.gstatic.com', rel: 'preconnect' },
@@ -57,14 +57,39 @@ export default defineNuxtConfig({
5757
modules: [
5858
'@nuxtjs/tailwindcss',
5959
'@pinia/nuxt',
60+
'@vite-pwa/nuxt',
6061
'@vueuse/nuxt',
6162
],
63+
nitro: {
64+
prerender: {
65+
routes: [
66+
'/',
67+
'/home',
68+
'/settings',
69+
],
70+
},
71+
},
6272
postcss: {
6373
plugins: {
6474
tailwindcss: {},
6575
autoprefixer: {},
6676
},
6777
},
78+
pwa: {
79+
...pwaConfig,
80+
base: '/',
81+
client: {
82+
registerPlugin: true,
83+
},
84+
devOptions: {
85+
enabled: true,
86+
type: 'module',
87+
},
88+
includeManifestIcons: true,
89+
registerWebManifestInRouteRules: true,
90+
scope: '/',
91+
writePlugin: true,
92+
},
6893
router: {
6994
options: {
7095
strict: true,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@types/mime-types": "^2.1.1",
4444
"@types/node": "^18.0.6",
4545
"@types/remarkable": "^2.0.3",
46+
"@vite-pwa/nuxt": "^0.0.4",
4647
"@vueuse/core": "^9.9.0",
4748
"@vueuse/head": "^1.0.22",
4849
"@vueuse/nuxt": "^9.9.0",
@@ -60,7 +61,7 @@
6061
"typescript": "^4.7.4",
6162
"vercel": "^28.10.1",
6263
"vite": "^4.0.2",
63-
"vite-plugin-pwa": "^0.13.3",
64+
"vite-plugin-pwa": "^0.14.1",
6465
"vite-svg-loader": "^3.6.0",
6566
"vue-tsc": "^0.38.9",
6667
"workbox-build": "^6.3.0",

pages/home.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default defineComponent({
7979
</section>
8080
<section class="p-4 lg:p-8">
8181
<div class="container mx-auto max-w-[100ch]">
82-
<img src="/img/screenshot.png?v=MjAyMi0xMi0xMVQxMDoxMjoyMS0wNTAwCg==" alt="The Octo editor with an in-progress Markdown document in focus." width="1600" height="900" class="w-full" />
82+
<img src="~/assets/screenshot.png" alt="The Octo editor with an in-progress Markdown document in focus." width="1600" height="900" class="w-full" />
8383
</div>
8484
</section>
8585
<section class="p-4 lg:p-8">

0 commit comments

Comments
 (0)