Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making it work with some postcss plugins #12

Open
8lall0 opened this issue Apr 30, 2021 · 1 comment
Open

Making it work with some postcss plugins #12

8lall0 opened this issue Apr 30, 2021 · 1 comment

Comments

@8lall0
Copy link

8lall0 commented Apr 30, 2021

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 :)

@martonlederer
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants