create-figma-plugin icon indicating copy to clipboard operation
create-figma-plugin copied to clipboard

esbuild plug-ins postcss / tailwindcss not working

Open emkayy opened this issue 10 months ago • 1 comments

I tried adding tailwind through an esbuild plug-in in various different ways. However, it seems like the plug-ins are never initiated. This is my build-figma-plugin.main.js:

const { tailwindPlugin } = require("esbuild-plugin-tailwindcss");
const postcss = require("esbuild-postcss");

module.exports = function (buildOptions) {
  const config = {
    ...buildOptions,
    plugins: [...buildOptions.plugins, postcss() /* tailwindPlugin() */],
  };
  return config;
};

I also tried passing the plugin config directly:

plugins: [
    postcss({
      plugins: [
        tailwindcss('./tailwind.config.js'), // also tried without config path and passing config object
      ],
    }),
  ],

Here is a minimal setup tailwindpostcss.zip

Is there a special way you have to add / configure esbuild plug-ins?

emkayy avatar Apr 21 '24 12:04 emkayy

Suggest using the plugin/preact-tailwindcss template

yuanqing avatar Jul 29 '24 22:07 yuanqing