gulp.task('build', () => {
return gulp.src([
'node_modules/babel-polyfill/dist/polyfill.js',
'app.js'
])
//...
})
// promise.js
_Promise = require('babel-runtime/core-js/promise').default;
// gulpfile.js
const gulp = require('gulp');
const concat = require('gulp-concat');
const header = require('gulp-header');
const webpack = require('webpack-stream');
gulp.task('build-promise' ,() =>{
return gulp.src('promise.js')
.pipe(webpack())
.pipe(header(`
let _Promise;
`))
// ....
.pipe(concat('promise.js'))
.pipe(gulp.dest('dist'));
})