Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!