wingsuit-designsystem / wingsuit

Twig for Storybook
GNU General Public License v2.0
91 stars 16 forks source link

Purging CSS is enabled during devlopment when using Tailwind CSS preset #149

Closed miloskroulik closed 3 years ago

miloskroulik commented 3 years ago

According to Tailwind CSS documentation, purging should be disabled, when the NODE_ENV environment variable isn't set to production.

Now whenever you compile your CSS with NODE_ENV set to production, Tailwind will automatically purge unused styles from your CSS.

Source: https://tailwindcss.com/docs/optimizing-for-production#basic-usage

However, when I'm developing my site using yarn dev:drupal it still seems to be applied (when I add class to my twig file, I can see it being added to generated tokens.css file), even though NODE_ENV is set to development. How can I disable it during development?

christianwiedemann commented 3 years ago

The JIT compiler is activated in your postcss config. https://tailwindcss.com/docs/just-in-time-mode

You can disable the jit compiler in the postcss config.

miloskroulik commented 3 years ago

Sorry, I didn't realize it causes this behaviour. Thanks