glromeo / esbuild-sass-plugin

esbuild plugin for sass
MIT License
155 stars 40 forks source link

postcss Unocss inoperative #150

Closed zhangchenna closed 11 months ago

zhangchenna commented 1 year ago

import esbuild from 'esbuild'; import { sassPlugin } from 'esbuild-sass-plugin'; import postcss from 'postcss'; import postcssUnocss from '@unocss/postcss';

sassPlugin({ async transform(source) { const { css } = await postcss([ ...postcssPlugins, postcssUnocss({ content: ['src/*/.{js,ts,jsx,tsx,vue}'], }), ]).process(source); return css; }, }),

// unocss Not transferred correctly @unocss;.qt-button-group{width:100%;background-color:#fff}

glromeo commented 1 year ago

I am sorry but I can't look into 3rd party postcss plugin issues... unless, have you checked what is returned in css ? just a console log before the return css is enough to see whether your call to postcss yields the results you expect. I guess if there's an issue is with the call to post css...in any case this is beyond the scope of this plugin