【发布时间】:2019-05-19 06:03:25
【问题描述】:
我一直在通过为 transform-object-assign 和 array-includes 添加插件来拼凑对 IE11 的支持,现在我在使用 for of 循环时遇到符号错误。除了一次解决一个问题,我是否可以将 babel polyfill 应用到我的下面的构建中并在未来证明它?
我已经阅读了几个相关的问题,但仍然不清楚如何将 babel-polyfill 放入下面的 gulp 构建中:
return gulp.src(input) // Grab the input files
.pipe($.babel({
presets: ['es2015'], // transform ES6 to ES5 with Babel
plugins: ['transform-object-assign','array-includes']
}))
.pipe($.concat(outputFile))
.pipe($.uglify({
compress: {
drop_debugger: true
}
}))
.pipe(gulp.dest(paths.output)) // Output file destination
.pipe($.connect.reload());
}
【问题讨论】:
标签: javascript gulp internet-explorer-11 babeljs polyfills