Answer the question
In order to leave comments, you need to log in
How to connect babel polyfills?
There is a galp and a babel.
No webpack, brazify, etc.
A library is developed with the maximum minimum file size.
There was a need to use promises.
If you add babel polyfills to gulp task
gulp.task('build', () => {
return gulp.src([
'node_modules/babel-polyfill/dist/polyfill.js',
'app.js'
])
//...
})
Answer the question
In order to leave comments, you need to log in
solution for anyone interested
// 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'));
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question