Coder Social home page Coder Social logo

πŸ‘‹ Great project! about jet HOT 9 CLOSED

marcamos avatar marcamos commented on June 14, 2024
πŸ‘‹ Great project!

from jet.

Comments (9)

 avatar commented on June 14, 2024

One thing I don't get is, why is postcss and tailwind both involved in the build process?

from jet.

 avatar commented on June 14, 2024

In the build process:

$ npm run tailwind && postcss src/css/styles.css --replace

Isn't Tailwind run twice?

from jet.

marcamos avatar marcamos commented on June 14, 2024

Hello Ryan!

Thanks for the kind words.

To (try) to answer your question: I built jet before Tailwind included its new purge option, so it was setup to purge and minify 'manually'.

A bit later, when Tailwind released its built-in purge option, I gave it a try. I compared the size of its output CSS to the size of my 'manual' solution's output CSS, and found the new purge option's output CSS to be larger. Bummer.

I didn't really investigate why, but quickly decided that I would just stick with my original 'manual' process, simply because its output was smaller.

Does that help?

from jet.

 avatar commented on June 14, 2024

Oh I see

from jet.

 avatar commented on June 14, 2024

But

$ npm run tailwind && postcss src/css/styles.css --replace

Tailwind is included in PostCSS, so the Tailwind build process is run on an already built Tailwind file...

const plugins = [
  tailwindcss('tailwind.config.js'),
  purgecss({
    content: ['src/**/*.html']
  }),
  cssnano()
]

from jet.

marcamos avatar marcamos commented on June 14, 2024

Aha, I understand what you mean now β€”Β thanks for the clarification! You may be right; I'm going to do some testing as soon as I can, and I'll update this issue.

from jet.

marcamos avatar marcamos commented on June 14, 2024

I did some testing and here's what I discovered:

When I adjust the build script to be the following: "postcss src/css/styles.css --replace && npm run clean && npx @11ty/eleventy", the compiled CSS no longer picks up the classes in the HTML.

from jet.

marcamos avatar marcamos commented on June 14, 2024

Aha, but if I do the opposite: remove the call to Tailwind from the postcss.config.js file, as seen in 339f02a, it continues to work as desired.

Thank you so much @ryanccn! This has been a great tip.

from jet.

 avatar commented on June 14, 2024

Glad to help! πŸ˜‡

from jet.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.