DWQA QuestionsCategory: ProgramSometimes there is ES6 code after Babel conversion. Why
Shanny asked 4 weeks ago

As deconstructed, {A: 1, B: 1,… C}
After the transfer, it is still {a:1, b:1,… C},

  1. Babel does not want to convert ES6 to Es5, but to convert less supported features into more supported writing methods
  2. In this way, code writers can use the latest and most advanced writing methods. In the future, the whole user client will be upgraded without modifying the code and the Babel configuration
  3. So @ Babel / preset env is generally used to convert which codes can be configured
  4. So you should first look at your own configuration. If necessary, you can add some plug-ins manually

,Babel does not switch to node by default_ Are the modules code dependent on the ES6 code in the package?,https://kangax.github.io/comp…
Here you can see which syntax and APIs will be escaped.

joyqi replied 4 weeks ago

I’ll delete it if I don’t add any more

joyqi replied 4 weeks ago

Please use the comment function

joyqi replied 4 weeks ago

Questions should be put in comments, not in answers.

joyqi replied 4 weeks ago

@fenYes, it is executed at the terminal

joyqi replied 4 weeks ago

Please ignore this clause

3 Answers
Meathill answered 4 weeks ago
  1. Babel does not want to convert ES6 to Es5, but to convert less supported features into more supported writing methods
  2. In this way, code writers can use the latest and most advanced writing methods. In the future, the whole user client will be upgraded without modifying the code and the Babel configuration
  3. So @ Babel / preset env is generally used to convert which codes can be configured
  4. So you should first look at your own configuration. If necessary, you can add some plug-ins manually
Shanny replied 4 weeks ago

Yes, even with @ Babel / preset Env and Polyfill

Meathill replied 4 weeks ago

@ShannyThat is, according to your configuration, this does not need to be converted.

The road is white from tonight answered 4 weeks ago

Babel does not switch to node by default_ Are the modules code dependent on the ES6 code in the package?

Shanny replied 4 weeks ago

This is a component library. The packaged entry is an object, and each attribute represents a component. Is it the reason for this entrance

gentlecoder answered 4 weeks ago

https://kangax.github.io/comp…
Here you can see which syntax and APIs will be escaped.