feat: use package version as asset cache version ID
This commit is contained in:
parent
df8c8f1030
commit
a05755169a
1 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,8 @@ import { defineConfig } from 'astro/config'
|
||||||
import serviceWorker from '@ayco/astro-sw'
|
import serviceWorker from '@ayco/astro-sw'
|
||||||
import sitemap from '@astrojs/sitemap'
|
import sitemap from '@astrojs/sitemap'
|
||||||
|
|
||||||
|
import * as data from './package.json'
|
||||||
|
|
||||||
import icon from 'astro-icon'
|
import icon from 'astro-icon'
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
|
@ -16,7 +18,7 @@ export default defineConfig({
|
||||||
serviceWorker({
|
serviceWorker({
|
||||||
path: './src/sw.mjs',
|
path: './src/sw.mjs',
|
||||||
assetCachePrefix: 'ayco-personal-site',
|
assetCachePrefix: 'ayco-personal-site',
|
||||||
assetCacheVersionID: 'sigma',
|
assetCacheVersionID: data.version,
|
||||||
logAssets: true,
|
logAssets: true,
|
||||||
esbuild: {
|
esbuild: {
|
||||||
minify: true,
|
minify: true,
|
||||||
|
|
Loading…
Reference in a new issue