Vue-cli 's question about es6

for example,

let a=1;
for(let i=0;i<3;iPP){
    console.log(a);
    let a=2;
} 

running in the browser"s console will report an error, and I know the reason.
outputs undefined,2,2 when running in vue-cli. If I comment out the babel in loader, the result is still the same

what I want to ask is why? How do I get vue-cli to run es6 directly (making the results the same as in the console)?

Mar.31,2021

in addition to optimizing the babel, code when it is compressed, you can turn off or configure the use of uglifyjs-webpack-plugin

.
Menu