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

291
Visualizações
Using an ES module in TailwindCSS config (Using React and Craco)

I've been trying for hours to import the package d3-colors into my tailwind.config.js. No solutions I have found on the internet have worked so far.

I have tried:

  • Converting it to tailwind.config.mjs, but then it doesn't get loaded. The configuration does not work.

  • Using the await import('colors-d3') but that doesn't work either because then I have to await the function that gets it, and that's not allowed either:

module.exports = await config();
SyntaxError: await is only valid in async functions and the top level bodies of modules
  • I've tried changing the package to type='module', but then I have all sorts of issues with Craco not being able to load it's config once I convert it to an ESM module because craco itself is commonjs.

  • I have tried modifying Craco's config...

  • I've tried using a postcss config file to pass the tailwind.config.mjs as the config file parameter, doesn't work either.

etc etc

I can't get it to work. How can I just import this module into my tailwind config?

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

0

According to the team, they won't be supporting ESM anytime soon.

https://github.com/tailwindlabs/tailwindcss/issues/8029#issuecomment-1086875656

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