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
90 stars 15 forks source link

postcss.config.cjs as ESM module #24

Closed thiccnfun closed 2 months ago

thiccnfun commented 3 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 2 months ago

Made this the standard way for next release