theelims / ESP32-sveltekit

A simple and extensible framework for ESP32 based IoT projects with a feature-rich, beautiful, and responsive front-end build with Sveltekit, Tailwind CSS and DaisyUI. This is a project template to get you started in no time with a fully integrated build chain.
https://theelims.github.io/ESP32-sveltekit/
Other
118 stars 22 forks source link

postcss.config.cjs as ESM module #24

Closed thiccnfun closed 7 months ago

thiccnfun commented 9 months ago

This isn't so much an issue, but something I wanted to share here.

Longer story short, I was having a hard time getting the postcss-remove-class plugin to work with the way postcss.config.cjs was defined.

This ESM approach worked better for me (renamed as postcss.config.js):

import tailwindcss from 'tailwindcss';
import autoprefixer from 'autoprefixer';
import postcssRemoveClasses from 'postcss-remove-classes';

export default {
  plugins: [
    tailwindcss(),
    autoprefixer(),
    postcssRemoveClasses.default('range'),
  ],
}

There may be a solution using the previous format of the file, but I wasn't finding the approach very intuitive 🤷

theelims commented 7 months ago

Made this the standard way for next release