Gulp babel not transpiling to es5
See original GitHub issueI installed gulp babel (and dependencies) and when running gulp, same es6 code is being output in dist. I tried adding .babelrc to specify preset as well as specifying preset in gulp.
Is there anything I am missing?
gulpfile
var gulp = require('gulp');
var babel = require('gulp-babel');
gulp.task( 'customJS', function() {
gulp.src( [ jsCustomSRC ] )
.pipe( concat( jsCustomFile + '.js' ) )
.pipe(babel({
presets: ['@babel/env']
}))
.pipe( gulp.dest( jsDestination ) )
});
.babelrc
{
"presets": ["@babel/env"]
}
package.json
"devDependencies": {
"@babel/core": "^7.1.5",
"@babel/preset-env": "^7.1.5",
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0",
"gulp-concat": "^2.5.2"
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:21
- Comments:22 (1 by maintainers)
Top Results From Across the Web
gulp-babel transpile from >=ES6 to ES5 - Stack Overflow
So it turns out, that is is expected. Babel would only transpile ES6 and above to ES5. Module like browserify or webpack needs...
Read more >How to convert ES6 to ES5 using Babel with Gulp - Hydroid
To use ES6 Code in your application, we need to transpile the ES6 code into ES5 code using babel so that it can...
Read more >How to Use ES2015 Today with Babel and Gulp
It performs transpilation from ES2015 to ES5 on the fly. However, babel-node is not recommended for production use due to the overhead of ......
Read more >Working with BabelJS and Gulp - Tutorialspoint
js as a platform. Gulp will run the tasks that will transpile JavaScript files from es6 to es5 and once done will start...
Read more >[Solved]-gulp-babel transpile from >=ES6 to ES5-babel.js
If you are using babel version 7, you need to gulp-babel version 8 which you can get npm run i --save-dev gulp-babel for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also had this probleem but wrapping it in a second array will fix it,
I have the same issue I got no files being created nor do I get any error by the task where babel runs.
For completeness I’ve include my code below.
packages.js
Task: