esbuild-plugin-postcss2
esbuild-plugin-postcss2 copied to clipboard
Making it work with some postcss plugins
Hello, here i am again.
I'm trying to run some postcss plugins without luck.
I'm parsing a sass file and then i use autoprefixer, and it works like a charm. Now i'm trying to minify the output, with cssnano.
const esbuild = require('esbuild');
const postCSSPlugin = require('esbuild-plugin-postcss2');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
esbuild.build({
entryPoints: ['index.js'],
bundle: true,
outfile: 'dist/bundle.js',
plugins: [
postCSSPlugin.default({
plugins: [
autoprefixer,
cssnano,
],
}),
],
}).catch((e) => console.error(e.message))
It doesn't give me any error, but it's not minifying anything.
Can you help me? thanks :)
Hey there, I have not used many plugins before, but maybe that would only work with the postcss compiler directly? I really don't know, if I have time later, I might try to reproduce this