agneym / preact-cli-tailwind

Preact CLI Plugin that helps add Tailwind CSS to your project
MIT License
32 stars 4 forks source link

Tailwind CSS output not optimized #15

Closed helgeolav closed 3 years ago

helgeolav commented 3 years ago

Hi

I have been trying to get Preact and Tailwind to work together using the README file. I have it working but when I run 'npm run build' it takes a minute or so to build. But the output CSS files are about 3MB in size.

My question is if this tool is designed to optimize the production build? Or this is what I get.

This is a new build created like this:

npx preact-cli create simple myproject
cd myproject
npm i tailwindcss
npm -D i preact-cli-tailwind

I also preact.config.js as described and imported tailwind into src/styles.css (Added: @tailwind base;@tailwind components;@tailwind utilities)

The versions running from package.json is:

  "devDependencies": {
    "eslint": "^7.17.0",
    "eslint-config-preact": "^1.1.3",
    "preact-cli": "^3.0.0",
    "preact-cli-tailwind": "^3.0.0",
    "sirv-cli": "^1.0.3",
    "tailwindcss": "^2.2.7"
  },
  "dependencies": {
    "preact": "^10.1.0",
    "preact-render-to-string": "^5.1.2"
agneym commented 3 years ago

Hi @helgeolav

This project only helps setup tailwindcss as a postcss plugin on preact project. Any sort of optimisation is handled on tailwind.config file. Read tailwind docs for more information.