class Foo {
constructor(...args) {
this.args = args;
}
* [Symbol.iterator]() {
for (let arg of this.args) {
yield arg;
}
}
}
for (let x of new Foo('hello', 'world')) {
console.log(x);
}
我用webpack中的babel-loader编译上面的一段es6代码,编译的后的文件竟然有2万多行!着实把我吓了一跳,是不是我配置有问题?我都不敢用es6了,希望知道的帮忙解答一下,谢谢!
webpack配置文件如下截图:
react-hot大概是因为有这个东西吧,HotModuleReplacementPlugin也会在bundle里加许多代码