feat: webfont plugin (#468)

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
This commit is contained in:
Bálint Szekeres 2023-03-27 12:02:33 +02:00 committed by GitHub
parent 3df765394b
commit 9071f056b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 592 additions and 351 deletions

View File

@ -56,6 +56,8 @@ Mocking up web app with <b>Vitesse</b><sup><em>(speed)</em></sup><br>
- 🦔 Critical CSS via [critters](https://github.com/GoogleChromeLabs/critters)
- 🔤 [Webfont self-hosting](https://github.com/feat-agency/vite-plugin-webfont-dl)
- 🦾 TypeScript, of course
- ⚙️ Unit Testing with [Vitest](https://github.com/vitest-dev/vitest), E2E Testing with [Cypress](https://cypress.io/) on [GitHub Actions](https://github.com/features/actions)
@ -95,6 +97,7 @@ Mocking up web app with <b>Vitesse</b><sup><em>(speed)</em></sup><br>
- [`vite-ssg-sitemap`](https://github.com/jbaubree/vite-ssg-sitemap) - Sitemap generator
- [`@vueuse/head`](https://github.com/vueuse/head) - manipulate document head reactively
- [`vite-plugin-vue-inspector`](https://github.com/webfansplz/vite-plugin-vue-inspector) - jump to local IDE source code while click the element of browser automatically
- [`vite-plugin-webfont-dl`](https://github.com/feat-agency/vite-plugin-webfont-dl) - Zero-config webfont (Google Fonts) downloader and injector to improve website's performance.
### Coding Style

View File

@ -61,6 +61,7 @@
"vite-plugin-vue-inspector": "^3.4.0",
"vite-plugin-vue-layouts": "^0.8.0",
"vite-plugin-vue-markdown": "^0.22.4",
"vite-plugin-webfont-dl": "^3.6.0",
"vite-ssg": "^0.22.1",
"vite-ssg-sitemap": "^0.4.3",
"vitest": "^0.29.3",

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,7 @@ import LinkAttributes from 'markdown-it-link-attributes'
import Unocss from 'unocss/vite'
import Shiki from 'markdown-it-shiki'
import VueMacros from 'unplugin-vue-macros/vite'
import WebfontDownload from 'vite-plugin-webfont-dl'
export default defineConfig({
resolve: {
@ -143,6 +144,9 @@ export default defineConfig({
Inspector({
toggleButtonVisibility: 'never',
}),
// https://github.com/feat-agency/vite-plugin-webfont-dl
WebfontDownload(),
],
// https://github.com/vitest-dev/vitest
@ -158,6 +162,9 @@ export default defineConfig({
ssgOptions: {
script: 'async',
formatting: 'minify',
crittersOptions: {
reduceInlineStyles: false,
},
onFinished() { generateSitemap() },
},