Skip to content

Commit

Permalink
feat: 提取字体文件
Browse files Browse the repository at this point in the history
  • Loading branch information
ZvonimirSun committed Jan 6, 2024
1 parent 602aeb8 commit de88767
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/views/zeldaBotwMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ onMounted(() => {
trackResize: true
}).setView([0, 0], 2))
tileLayer('https://lib.iszy.xyz/other/zelda-botw-map/map/{z}_{x}_{y}.png', {
tileLayer('https://lib.demos.pub/other/zelda-botw-map/map/{z}_{x}_{y}.png', {
minZoom: 2,
maxZoom: 7,
noWrap: true,
bounds
}).addTo(_map.value)
tileLayer('https://lib.iszy.xyz/other/zelda-botw-map/label/{z}_{x}_{y}.png', {
tileLayer('https://lib.demos.pub/other/zelda-botw-map/label/{z}_{x}_{y}.png', {
minZoom: 2,
maxZoom: 7,
noWrap: true,
Expand Down
14 changes: 6 additions & 8 deletions uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
presetAttributify,
presetIcons,
presetUno,
presetWebFonts
transformerDirectives,
transformerVariantGroup
} from 'unocss'
import tools from './src/tools.json'

Expand All @@ -18,15 +19,12 @@ export default defineConfig({
extraProperties: {
display: 'inline-block'
}
}),
presetWebFonts({
fonts: {
sans: 'Lora:300,400,700',
serif: 'Noto Serif SC:300,400,700',
mono: 'JetBrains Mono:300,400,700'
}
})
],
transformers: [
transformerDirectives(),
transformerVariantGroup()
],
safelist: [
'i-icon-park-solid-all-application',
'i-icon-park-outline-history',
Expand Down
40 changes: 11 additions & 29 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,41 +109,23 @@ export default defineConfig({
statuses: [0, 200]
}
}
},
{
urlPattern: /^https:\/\/.*cdn\.iszy\.cc/,
handler: 'CacheFirst',
options: {
cacheName: 'iszycc-cdn',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365 // <== 365 days
},
cacheableResponse: {
statuses: [0, 200]
}
}
},
{
urlPattern: /^https:\/\/lib\.iszy\.xyz/,
handler: 'CacheFirst',
options: {
cacheName: 'iszylib-cdn',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 7 // <== 365 days
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
}
}),
Sitemap({ tools, hostname: 'https://tools.iszy.xyz' }),
manualChunksPlugin(),
WebfontDownload(),
WebfontDownload(
[
'https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=Lora:ital,wght@0,400;0,700;1,400;1,700&family=Noto+Serif+SC:wght@300;400;700&display=swap'
], {
injectAsStyleTag: false,
minifyCss: true,
async: true,
cache: true,
proxy: false
}
),
VueDevTools()
],
optimizeDeps: {
Expand Down

0 comments on commit de88767

Please sign in to comment.