H
H
Hello World2021-11-06 11:48:45
JavaScript
Hello World, 2021-11-06 11:48:45

Babel() not working in Gulp?

Good afternoon!
I am building Gulp for my project, but for some reason, when building Js, it does not get into the output folder (build), I found out that Babel is to blame for all this, js is generated without it.
package.json

"devDependencies"{
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.0",
"gulp-babel": "^8.0.0"
}

JS task
function JS(done) {
    gulp.src(path.src.js)
        .pipe(babel())
        .pipe(uglify({ annotations: false }))
        .pipe(rename({ suffix: '.min' }))
        .pipe(gulp.dest(path.app.js))
        .pipe(browserSync.stream());
    done();
}

.babelrc
{
    "presets": ["@babel/preset-env"]
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question