daflh / eleventy-plugin-tailwindcss

An Eleventy plugin to add Tailwind CSS support for your website
MIT License
31 stars 9 forks source link

Builds file locally, but not when deployed to Netlify/Vercel #18

Closed michaelroper closed 3 years ago

michaelroper commented 3 years ago

Hi Dafiul - thanks for the plug-in, seems to be a nice clean way to integrate Tailwind!

I've added it to my project, and while it builds the CSS file locally without issue, it just doesn't seem to output anything when I deploy it to Netlify or Vercel.

CLI output on local environment:

$ NODE_ENV=production eleventy
[Eleventy-Plugin-TailwindCSS] Using tailwind.config.js as Tailwind config file
[Eleventy-Plugin-TailwindCSS] Wrote dist/assets/css/styles.css from assets/css/styles.css
Writing dist/sitemap.xml from ./pages/sitemap.xml.njk.
Writing dist/404.html from ./pages/404.md.
Writing dist/index.html from ./pages/home.njk.
Writing dist/resume/index.html from ./pages/resume.md.
Copied 11 files / Wrote 4 files in 4.02 seconds (v0.11.1)
✨  Done in 6.50s.

Output from Netlify build log:

$ NODE_ENV=production eleventy
[Eleventy-Plugin-TailwindCSS] Using tailwind.config.js as Tailwind config file
Writing dist/sitemap.xml from ./pages/sitemap.xml.njk.
Writing dist/404.html from ./pages/404.md.
Writing dist/index.html from ./pages/home.njk.
Writing dist/resume/index.html from ./pages/resume.md.
Copied 11 files / Wrote 4 files in 0.21 seconds (v0.11.1)
Done in 1.21s.

No errors, but just doesn't process the CSS file for some reason. Any ideas what the difference might be?

daflh commented 3 years ago

Can you give the code for me to reproduce?

michaelroper commented 3 years ago

Yes, this should do it: https://github.com/michaelroper/michael.roper.id.au/tree/tw-build-test

daflh commented 3 years ago

Looks like you added your CSS file to gitignore. As you can see here, the file assets/css/styles.css doesn't exist in the remote repository.

michaelroper commented 3 years ago

Oh wow, that's exactly it - how did I miss that!? Thanks for the fresh eyes!