-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: - rename virtual "virtual:fonts.css" to "unfonts.css" - rename package "vite-plugin-fonts" to "unplugin-fonts"
- Loading branch information
1 parent
9714960
commit 5ae235a
Showing
48 changed files
with
8,395 additions
and
1,865 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
*.snap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ignore-workspace-root-check=true | ||
shamefully-hoist=true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { defineConfig } from 'astro/config' | ||
import Unfonts from 'unplugin-fonts/astro' | ||
|
||
export default defineConfig({ | ||
integrations: [ | ||
Unfonts({ | ||
google: { | ||
families: ['Crimson Pro', 'Open Sans', 'Material+Icons'], | ||
}, | ||
|
||
custom: { | ||
display: 'swap', | ||
families: { | ||
'Dancing Script': './public/assets/fonts/DancingScript*', | ||
}, | ||
}, | ||
}) | ||
], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "astro-test", | ||
"private": true, | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"devDependencies": { | ||
"astro": "^2.1.3", | ||
"unplugin-fonts": "workspace:*" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="astro/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
// import "/@unplugin-fonts/fonts.css"; | ||
--- | ||
|
||
<div> | ||
<h1>Hello Astro!</h1> | ||
<h2>I'm using a local font !</h2> | ||
<a href="https://vitejs.dev/guide/features.html" target="_blank">Documentation</a> | ||
</div> | ||
|
||
<style> | ||
body { | ||
font-family: "Crimson Pro", Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
margin-top: 60px; | ||
} | ||
|
||
a { | ||
font-family: "Open Sans", Avenir, Helvetica, Arial, sans-serif; | ||
} | ||
|
||
h2 { | ||
font-family: "Dancing Script", sans-serif; | ||
font-size: 3rem; | ||
font-weight: 600; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"jsx": "preserve", | ||
// Enable top-level await, and other modern ESM features. | ||
"target": "ESNext", | ||
"module": "ESNext", | ||
// Enable node-style module resolution, for things like npm package imports. | ||
"moduleResolution": "node", | ||
// Enable JSON imports. | ||
"resolveJsonModule": true, | ||
// Enable stricter transpilation for better output. | ||
"isolatedModules": true, | ||
// Astro will directly run your TypeScript code, no transpilation needed. | ||
"noEmit": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
*.log* | ||
.nuxt | ||
.nitro | ||
.cache | ||
.output | ||
.env | ||
dist | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<template> | ||
<h1>Hello Nuxt!</h1> | ||
<h2>I'm using a local font !</h2> | ||
<a href="https://vitejs.dev/guide/features.html" target="_blank">Documentation</a> | ||
</template> | ||
|
||
<style> | ||
body { | ||
font-family: "Crimson Pro", Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
margin-top: 60px; | ||
} | ||
a { | ||
font-family: "Open Sans", Avenir, Helvetica, Arial, sans-serif; | ||
} | ||
h2 { | ||
font-family: "Dancing Script", sans-serif; | ||
font-size: 3rem; | ||
font-weight: 600; | ||
} | ||
</style> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Unfonts from '../../src/nuxt' | ||
|
||
export default defineNuxtConfig({ | ||
modules: [ | ||
Unfonts, | ||
], | ||
fonts: { | ||
google: { | ||
families: ['Crimson Pro', 'Open Sans', 'Material+Icons'], | ||
}, | ||
|
||
custom: { | ||
display: 'swap', | ||
families: { | ||
'Dancing Script': './assets/fonts/DancingScript*', | ||
}, | ||
}, | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "nuxt-test", | ||
"private": true, | ||
"scripts": { | ||
"dev": "nuxt dev", | ||
"build": "nuxt build", | ||
"preview": "nuxt preview" | ||
}, | ||
"devDependencies": { | ||
"nuxt": "^3.3.1", | ||
"unplugin-fonts": "workspace:*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
// https://nuxt.com/docs/guide/concepts/typescript | ||
"extends": "./.nuxt/tsconfig.json" | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import 'unfonts.css' | ||
import './style.css' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{ | ||
"name": "vite-test", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"devDependencies": { | ||
"vite": "^2.9.12", | ||
"vite-plugin-fonts": "workspace: *" | ||
"vite": "^4.2.0", | ||
"unplugin-fonts": "workspace:*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,103 @@ | ||
{ | ||
"name": "vite-plugin-fonts", | ||
"name": "unplugin-fonts", | ||
"version": "0.7.0", | ||
"description": "Webfont loader for vite", | ||
"author": "stafyniaksacha", | ||
"license": "MIT", | ||
"repository": "stafyniaksacha/vite-plugin-fonts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
}, | ||
"./astro": { | ||
"types": "./dist/astro.d.ts", | ||
"require": "./dist/astro.js", | ||
"import": "./dist/astro.mjs" | ||
}, | ||
"./esbuild": { | ||
"types": "./dist/esbuild.d.ts", | ||
"require": "./dist/esbuild.js", | ||
"import": "./dist/esbuild.mjs" | ||
}, | ||
"./nuxt": { | ||
"types": "./dist/nuxt.d.ts", | ||
"require": "./dist/nuxt.js", | ||
"import": "./dist/nuxt.mjs" | ||
}, | ||
"./rollup": { | ||
"types": "./dist/rollup.d.ts", | ||
"require": "./dist/rollup.js", | ||
"import": "./dist/rollup.mjs" | ||
}, | ||
"./types": { | ||
"types": "./dist/types.d.ts", | ||
"require": "./dist/types.js", | ||
"import": "./dist/types.mjs" | ||
}, | ||
"./vite": { | ||
"types": "./dist/vite.d.ts", | ||
"require": "./dist/vite.js", | ||
"import": "./dist/vite.mjs" | ||
}, | ||
"./webpack": { | ||
"types": "./dist/webpack.d.ts", | ||
"require": "./dist/webpack.js", | ||
"import": "./dist/webpack.mjs" | ||
}, | ||
"./*": "./*" | ||
}, | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"./dist/*", | ||
"./*" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"dev": "npm run build -- --watch", | ||
"example:dev": "npm -C example run dev", | ||
"example:build": "npm -C example run build", | ||
"example:preview": "npm -C example run preview", | ||
"build": "tsup src/index.ts --dts --format cjs,esm", | ||
"build": "tsup", | ||
"dev": "tsup --watch src", | ||
"build:fix": "esno scripts/postbuild.ts", | ||
"example:dev": "npm -C examples/vite run dev", | ||
"example:build": "npm -C examples/vite run build", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint --fix ." | ||
}, | ||
"peerDependencies": { | ||
"@nuxt/kit": "^3.0.0", | ||
"vite": "^2.0.0 || ^3.0.0 || ^4.0.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@nuxt/kit": { | ||
"optional": true | ||
} | ||
}, | ||
"dependencies": { | ||
"fast-glob": "^3.2.11" | ||
"fast-glob": "^3.2.12", | ||
"unplugin": "^1.3.1" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config-ts": "^0.25.1", | ||
"@typescript-eslint/eslint-plugin": "^5.29.0", | ||
"eslint": "^8.18.0", | ||
"@antfu/eslint-config-ts": "^0.36.0", | ||
"@nuxt/kit": "^3.3.1", | ||
"@types/node": "^18.15.3", | ||
"@typescript-eslint/eslint-plugin": "^5.55.0", | ||
"chalk": "^5.2.0", | ||
"eslint": "^8.36.0", | ||
"eslint-plugin-eslint-comments": "^3.2.0", | ||
"tsup": "^6.1.2", | ||
"typescript": "^4.7.4", | ||
"vite": "^2.9.12" | ||
"esno": "^0.16.3", | ||
"pathe": "^1.1.0", | ||
"rollup": "^3.19.1", | ||
"tsup": "^6.6.3", | ||
"typescript": "^5.0.2", | ||
"vite": "^4.2.0", | ||
"webpack": "^5.76.2" | ||
} | ||
} |
Oops, something went wrong.