feat: use astro-sw customRoutes & add build:preview script

This commit is contained in:
Ayo Ayco 2024-08-15 21:15:12 +02:00
parent 4c4a206dc7
commit 81c7088975
3 changed files with 8 additions and 6 deletions

View file

@ -11,6 +11,7 @@ export default defineConfig({
serviceWorker({
path: './src/sw.js',
assetCachePrefix: 'ayco-personal-site',
customRoutes: ['/threads']
})
]
});

View file

@ -9,6 +9,7 @@
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"build:preview": "astro build && astro preview",
"deploy": "astro build && scp -r dist ayo@ayco.io:~/ayco.io-flask/",
"copy:dist": "astro build && cp -R dist ../ayco.io-flask/"
},
@ -16,7 +17,7 @@
"@astro-reactive/form": "^0.10.0",
"@astro-reactive/validator": "^0.5.0",
"@astrojs/sitemap": "^3.1.6",
"@ayco/astro-sw": "^0.3.1",
"@ayco/astro-sw": "^0.5.0",
"astro": "^4.14.2",
"astro-github-stats": "^0.7.0",
"astro-iconify": "^1.2.0"

View file

@ -18,8 +18,8 @@ importers:
specifier: ^3.1.6
version: 3.1.6
'@ayco/astro-sw':
specifier: ^0.3.1
version: 0.3.1
specifier: ^0.5.0
version: 0.5.0
astro:
specifier: ^4.14.2
version: 4.14.2(@types/node@22.3.0)(rollup@4.20.0)(typescript@5.5.4)
@ -75,8 +75,8 @@ packages:
resolution: {integrity: sha512-/ca/+D8MIKEC8/A9cSaPUqQNZm+Es/ZinRv0ZAzvu2ios7POQSsVD+VOj7/hypWNsNM3T7RpfgNq7H2TU1KEHA==}
engines: {node: ^18.17.1 || ^20.3.0 || >=21.0.0}
'@ayco/astro-sw@0.3.1':
resolution: {integrity: sha512-IK8nQ7zc+QkbqcvYaJKNtQ05pHl6uERVvo8fY9cafHZIQqPEbxFRiEM056C/4mCXTbbmlcvidsfWvpNbiyG+nw==}
'@ayco/astro-sw@0.5.0':
resolution: {integrity: sha512-anNaIOZdz5m4zKie52aePTVwO5YkNluHkqEGh6FpjS9D+W4RqWnWXDu613dMDsq3j97dXfvyPhmZaYZVJeiahQ==}
engines: {node: '>=18.0.0'}
'@babel/code-frame@7.24.7':
@ -2129,7 +2129,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@ayco/astro-sw@0.3.1': {}
'@ayco/astro-sw@0.5.0': {}
'@babel/code-frame@7.24.7':
dependencies: