Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

116
Visualizações
My PostCSS plugin does not work in a Vue-cli 3 project

so I wrote this postcss plugin that I'm trying to make use of. I tested it according to the postcss guidelines, and it worked as expected until I attempted to use it in an actual project.

Here's the plugin on GitHub

I'm trying to use it in a Vue-cli app (Webpack).

I installed the plugin with npm install. I have postcss & postcss-loader installed too (Ive tried different versions, reinstalling, but no luck)

Here's my postcss.config.js

module.exports = {
  plugins: [
    require("postcss-vwh"),
    //...
  ],
};

Update

Ok, so I created a new minimal application (without vue, only Webpack 5, css-loaders including latest version of postcss and the plugin) and it worked as expected!

So apparently the problem is not with my plugin after all, but with vue-cli. After hours of trying to make it work, I'm left with this error message:

Syntax Error: Error: PostCSS plugin postcss-vwh requires PostCSS 8.

Research shows that this error can be fixed by upgrading postcss-loader, but I'm forced by vue-cli to use version 4, which is the last version compatible with Webpack 4, on which my vue-cli app runs.

So, is there any way to make my plugin not as demanding maybe make it require lower version of postcss, so it can be used with Webpack 4?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

So I got an answer from creator of PostCSS here, which basically said, it's not recommended to try and support older postcss versions. Best approach is to update postcss.

So what I did was say bye-bye to vue-cli, manually created a new Webpack 5 / vue app from scratch, copied all my stuff there, installed postcss 8 and now it's working.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda