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

178
Visualizações
How to configure Babel to only output es2017/modern code?

I'm trying to configure web with optimize-plugin and babel to create module/nomodule bundles. In fact, I son't mind too much the nomodule thing, but I'd like to be sure to correctly configure babel to output es2017 code. In several tuts, for example this one, I've found a preset like 'es2017', but from babel docs it seems it's not supported anymore. Instead, I should use '@babel/preset-env' along with a browserlist config. It's not really clear to me how I should compose the browserlist. For now, I would say something like:

module.exports = { 
  presets : [ '@babel/preset-env' ],
  
  targets : {
    browsers: "last 2 versions, not dead, not IE 11",
    esmodules: true
  }
};

But not really sure.. Can someone tell me the perfect one? :)

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

0

I've just found an answer by reading this code that comes from here. It's simply:

'last 2 Chrome versions',
'last 2 Safari versions',
'last 2 iOS versions',
'last 2 Edge versions',
'Firefox ESR',

And not using the esmodules target due to this issue, as reported in comments on linked code above:

https://github.com/babel/babel/issues/8809

Even if probably with babel 8 we will be able to use it:

https://github.com/babel/babel/pull/12189

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