♻️(react) split fonts in a seperate CSS file

Fonts were de-facto included in the bundled dist/style.css file which
wasn't convenient in situations were consumers wanted to import fonts
by themselves.
This commit is contained in:
Nathan Vasse
2023-02-16 15:25:05 +01:00
committed by NathanVss
parent 479e0777b6
commit cd88e46537
8 changed files with 40 additions and 9 deletions

View File

@@ -16,7 +16,8 @@
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"./style": "./dist/style.css"
"./style": "./dist/style.css",
"./fonts": "./dist/fonts.css"
},
"files": [
"dist/"
@@ -24,7 +25,8 @@
"scripts": {
"lint": "eslint . 'src/**/*.{ts,tsx}'",
"dev": "yarn storybook & nodemon --watch src --ext '*' --ignore src/cunningham-tokens.ts --ignore src/cunningham-tokens.js --ignore src/cunningham-tokens.css --exec npm run build",
"build": "tsc && yarn build-theme && vite build",
"build": "tsc && yarn build-theme && vite build && yarn build-fonts",
"build-fonts": "vite build -c vite.fonts.config.ts && rm -rf dist/fonts.js",
"build-theme": "cunningham -o src -g css,ts,js",
"preview": "vite preview",
"test": "FORCE_COLOR=1 vitest run",