diff --git a/services/client/.gitignore b/services/client/.gitignore index a547bf3..b058b82 100644 --- a/services/client/.gitignore +++ b/services/client/.gitignore @@ -22,3 +22,5 @@ dist-ssr *.njsproj *.sln *.sw? + +safelist.txt \ No newline at end of file diff --git a/services/client/package.json b/services/client/package.json index 1f8932d..1142ed5 100644 --- a/services/client/package.json +++ b/services/client/package.json @@ -1,39 +1,41 @@ { - "name": "@sintra/client", - "private": true, - "version": "0.0.1", - "type": "module", - "scripts": { - "dev": "dotenv -e ../../.env.local vite", - "build": "tsc && vite build", - "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "preview": "dotenv -e ../../.env.local vite preview" - }, - "dependencies": { - "@emotion/react": "^11.11.1", - "@emotion/styled": "^11.11.0", - "@fontsource/roboto": "^5.0.8", - "@mui/material": "^5.14.18", - "@prisma/client": "^5.6.0", - "firebase": "^10.6.0", - "i18next": "^23.7.6", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-firebase-hooks": "^5.1.1", - "react-hook-form": "^7.48.2", - "react-i18next": "^13.5.0", - "react-router-dom": "^6.19.0", - "recoil": "^0.7.7" - }, - "devDependencies": { - "@types/react": "^18.2.15", - "@types/react-dom": "^18.2.7", - "@vitejs/plugin-react": "^4.0.3", - "autoprefixer": "^10.4.16", - "postcss": "^8.4.31", - "prettier": "^2.5.1", - "tailwindcss": "^3.3.5", - "typescript": "^5.0.2", - "vite": "^4.4.5" - } + "name": "@sintra/client", + "private": true, + "version": "0.0.1", + "type": "module", + "scripts": { + "dev": "dotenv -e ../../.env.local vite", + "build": "tsc && vite build", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "preview": "dotenv -e ../../.env.local vite build && dotenv -e ../../.env.local vite preview" + }, + "dependencies": { + "@emotion/react": "^11.11.1", + "@emotion/styled": "^11.11.0", + "@fontsource/roboto": "^5.0.8", + "@mui/material": "^5.14.18", + "@prisma/client": "^5.6.0", + "firebase": "^10.6.0", + "i18next": "^23.7.6", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-firebase-hooks": "^5.1.1", + "react-hook-form": "^7.48.2", + "react-i18next": "^13.5.0", + "react-router-dom": "^6.19.0", + "recoil": "^0.7.7", + "tailwind-safelist-generator": "^1.0.0", + "tailwindcss": "^3.3.5" + }, + "devDependencies": { + "@types/react": "^18.2.15", + "@types/react-dom": "^18.2.7", + "@vitejs/plugin-react": "^4.0.3", + "autoprefixer": "^10.4.16", + "postcss": "^8.4.31", + "prettier": "^2.5.1", + "tailwindcss": "^3.3.5", + "typescript": "^5.0.2", + "vite": "^4.4.5" + } } diff --git a/services/client/tailwind.config.js b/services/client/tailwind.config.js index 480234c..417c380 100644 --- a/services/client/tailwind.config.js +++ b/services/client/tailwind.config.js @@ -1,10 +1,20 @@ /** @type {import('tailwindcss').Config} */ + +import tailwindSafelistGenerator from 'tailwind-safelist-generator' + export default { - content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}",], + content: [ + "./index.html", + "./src/**/*.{js,ts,jsx,tsx}", + './safelist.txt' + ], theme: { extend: {}, }, - plugins: [], + plugins: [tailwindSafelistGenerator({ + path: 'safelist.txt', + patterns: ['bg-{colors}'], + })], important: true, } diff --git a/yarn.lock b/yarn.lock index 7c45a2c..bd11265 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6150,6 +6150,11 @@ synckit@^0.8.5: "@pkgr/utils" "^2.3.1" tslib "^2.5.0" +tailwind-safelist-generator@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/tailwind-safelist-generator/-/tailwind-safelist-generator-1.0.0.tgz#0726a2c84a5506eeb5ef9c7e41706b7f2a148356" + integrity sha512-3SmQijeTyEkP+z5UdOhygUJTm/iA0ic0eaM5O0cmGWyjABfTr/XwcY4nCIA09A4otPz1Ms6tqTCZ/DSRkg3M8A== + tailwindcss@^3.3.5: version "3.3.5" resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.3.5.tgz#22a59e2fbe0ecb6660809d9cc5f3976b077be3b8"