yuanqing / create-figma-plugin

:battery: The comprehensive toolkit for developing plugins and widgets for Figma and FigJam
https://yuanqing.github.io/create-figma-plugin/
MIT License
935 stars 89 forks source link

Allow optional SCSS support or custom PostCSS plugins #103

Open romannurik opened 2 years ago

romannurik commented 2 years ago

I most miss the ability to nest rules... It'd be nice to either support modules like postcss-nested (or whatever is defined in postcss.config.js) or SCSS support as an option.

romannurik commented 2 years ago

I think I found a hidden configuration option:

  1. Create a file named build-figma-plugin.ui.js
  2. Put the following contents in the file (and install esbuild-sass-plugin):
const { sassPlugin } = require('esbuild-sass-plugin');

module.exports = config => {
  config.plugins.push(sassPlugin());
  return config;
};