fix: fix preload
This commit is contained in:
parent
8f4702782b
commit
b9e9e2d691
6 changed files with 32 additions and 29 deletions
25
app.vue
25
app.vue
|
@ -27,31 +27,6 @@ useSeoMeta({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@font-face {
|
|
||||||
font-family: 'Open Sans';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
font-stretch: 100%;
|
|
||||||
font-display: swap;
|
|
||||||
src: url('/opensans.woff2') format('woff2');
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Roboto Condensed';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 300;
|
|
||||||
font-display: swap;
|
|
||||||
src: url('/roboto_con_reg.woff2') format('woff2');
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Roboto Condensed';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 700;
|
|
||||||
font-display: swap;
|
|
||||||
src: url('/roboto_con_bold.woff2') format('woff2');
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
* {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
24
assets/css/fonts.css
Normal file
24
assets/css/fonts.css
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Open Sans';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-stretch: 100%;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('/fonts/opensans.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Roboto Condensed';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 300;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('/fonts/roboto_con_reg.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Roboto Condensed';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('/fonts/roboto_con_bold.woff2') format('woff2');
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
|
ssr: true,
|
||||||
nitro: {
|
nitro: {
|
||||||
prerender: {
|
prerender: {
|
||||||
routes: [
|
routes: [
|
||||||
|
@ -7,6 +8,9 @@ export default defineNuxtConfig({
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
css: [
|
||||||
|
'~/assets/css/fonts.css'
|
||||||
|
],
|
||||||
routeRules: {
|
routeRules: {
|
||||||
'/': { prerender: true },
|
'/': { prerender: true },
|
||||||
'/imp': { prerender: true },
|
'/imp': { prerender: true },
|
||||||
|
@ -17,10 +21,10 @@ export default defineNuxtConfig({
|
||||||
link: [
|
link: [
|
||||||
{ rel: 'preload', as: 'image', href: '/img/profile_big.webp', type: 'image/webp' },
|
{ rel: 'preload', as: 'image', href: '/img/profile_big.webp', type: 'image/webp' },
|
||||||
{ rel: 'preload', as: 'image', href: '/img/profile_small.webp', type: 'image/webp' },
|
{ rel: 'preload', as: 'image', href: '/img/profile_small.webp', type: 'image/webp' },
|
||||||
{ rel: 'preload', as: 'font', href: '/opensans.woff2', type: 'font/woff2' },
|
{ rel: 'preload', crossorigin: 'anonymous', as: 'font', href: '/fonts/opensans.woff2', type: 'font/woff2' },
|
||||||
{ rel: 'preload', as: 'font', href: '/roboto_con_bold.woff2', type: 'font/woff2' },
|
{ rel: 'preload', crossorigin: 'anonymous', as: 'font', href: '/fonts/roboto_con_bold.woff2', type: 'font/woff2' },
|
||||||
{ rel: 'preload', as: 'font', href: '/roboto_con_reg.woff2', type: 'font/woff2' },
|
{ rel: 'preload', crossorigin: 'anonymous', as: 'font', href: '/fonts/roboto_con_reg.woff2', type: 'font/woff2' },
|
||||||
]
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue