From 30c4db4a17738a8765c37c34f1fd3a535d63b253 Mon Sep 17 00:00:00 2001 From: Rishabh Jain Date: Fri, 10 Jul 2020 22:13:36 +0530 Subject: [PATCH] feat: tailwind css fix --- package.json | 4 ++-- postcss.config.js | 2 +- src/tailwind.config.ts | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 01d5186..b1de77e 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "start": "react-scripts start", "build": "yarn build:tailwind && react-scripts build", "prebuild:css": "yarn build:tailwind", - "build:css": "postcss src/assets/tailwind.css -o src/assets/main.css", - "build:tailwind": "tsc ./src/tailwind.config.ts", + "build:css": "tailwindcss build ./src/assets/tailwind.css -o ./src/assets/main.css", + "build:tailwind": "tsc ./src/tailwind.config.ts && mv ./src/tailwind.config.js ./", "test": "react-scripts test", "eject": "react-scripts eject", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"", diff --git a/postcss.config.js b/postcss.config.js index 28da10e..7b135b1 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -3,5 +3,5 @@ const tailwindcss = require('tailwindcss'); module.exports = { - plugins: [tailwindcss('./src/tailwind.config.js'), require('autoprefixer')], + plugins: [tailwindcss('./tailwind.config.js'), require('autoprefixer')], }; diff --git a/src/tailwind.config.ts b/src/tailwind.config.ts index 1f60f0f..80a1bc2 100644 --- a/src/tailwind.config.ts +++ b/src/tailwind.config.ts @@ -1,5 +1,8 @@ const config = { - purge: [], + purge: { + enabled: true, + content: ['./src/**/*.tsx'], + }, target: 'relaxed', prefix: '', important: false, @@ -728,3 +731,5 @@ const config = { }; export default config; + +module.exports = config;