简体   繁体   中英

Babel 7 (webpack) transpile to most backwards compatible code

I am trying to configure webpack/babel 7 to transpile to the most backwards compatible code possible. But I still see things like includes and find in my code.

.babelrc

{
  "presets": [
    ["@babel/preset-env"]
  ],
}

How can I tell babel to do the most it can?

From https://babeljs.io/docs/en/babel-preset-env , we can use a browser list string or target browsers individually (see below for example).

 {
     "presets": [
         ["@babel/preset-env", {
             "targets" : ">0.001%" 
         } ] 
      ]
 }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM