Answer the question
In order to leave comments, you need to log in
Gulp how to bake ES6 under ES5?
I am making a project on ES6, the project uses import and exrpot.
Everything would be fine, but you need to bake a single file for old browsers, but I can’t find how to do it.
Here is an excerpt from gulpfile.js
gulp.task('merge', function(){
return (
gulp.src(srcFolder+"app.js")
.pipe(plumber())
// Notice the name change.
.pipe(concat("app.js"))
.pipe(
babel({
presets: ["@babel/env"]
})
)
.pipe(gulp.dest(dstFolder))
)
});
"use strict";
var _math = _interopRequireDefault(require("./utils/math"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
console.log(_math["default"].twoPlusTwo());
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question