Questions tagged [gulp-babel]

For questions related to the gulp-babel NPM package

gulp-babel allows using ES.next features in gulpfile.js via the babel transpiler.

See also (JavaScript build system) and (rewrites bleeding edge JavaScript features to run on EcmaScript 5 interpreters like V8).

55 questions
2
votes
2 answers

Show success message when gulp task is completed

I created a simple Gulp task to check for changes in my ES6 files. I would like to transpile them and show an error message when something went wrong. The error screen is being displayed. However, I would like to show a different message when…
Vernon
  • 443
  • 4
  • 23
2
votes
1 answer

gulp-babel change es6 to es5 require is not undefined

gulpfile.js gulp.task('es6', function() { gulp.src('libs/es6/*.js') .pipe(babel()) .pipe(gulp.dest('libs/js')) .pipe(concat('all.js')) .pipe(gulp.dest('libs/dist')) .pipe(rename('all.min.js')) …
2
votes
1 answer

How to chain in Gulp: Typescript to Babel to Webpack with source map?

I'm trying to create a gulp task that transforms TS -> (ES6) -> Babel -> (ES5) -> Webpack -> [bundle.js, bundle.js.map] where the source map maps back to the original TS code. How can I do this with gulp? So far, I've managed to get it working from…
jayars
  • 1,347
  • 3
  • 13
  • 25
1
vote
0 answers

Babel not transpiling

I'm using babel from gulp to attempt to create React code. When I run babel either from gulp or just from the commandline, the output of my code is exactly the same as the input. Nothing is changed. This is my babel.config.js const presets = [ …
bob
  • 753
  • 4
  • 15
  • 27
1
vote
2 answers

gulp-babel transpile from >=ES6 to ES5

I have been unable to transpile ES6 to ES5 using gulp-babel. This seems to be an open issue on github/babel/gulp-babel. However, I was able to get this working well with browserify Refer a sample I made But I am trying to use the gulp-babel…
Mahesh
  • 3,727
  • 1
  • 39
  • 49
1
vote
0 answers

Babel: is it possible to transpile Async Await functions in browser without Webpack or Browserify?

I'm using gulp-babel with babel 7 and the plugin-transform-runtime, but i get this error 'require is not defined', because it's a module and it's not working in browser. So is it necessary Webpack or Browserify to make it works? or maybe i'm doing…
Andre
  • 11
  • 2
1
vote
1 answer

Gulp4 - tasks did not complete and forget to signal async completion

Just started learning gulp and followed this tutorial series:https://www.youtube.com/watch?v=oRoy1fJbMls&list=PLriKzYyLb28lp0z-OMB5EYh0OHaKe91RV It works perfectly on gulp 3 but after updating npm to the current version it broke down and i tried…
Twirlman
  • 1,109
  • 2
  • 12
  • 30
1
vote
0 answers

how to fix error unnpr after minify with gulp-babel-minify

I am doing minify code with gulp-babel-minify and I get some error like this Uncaught Error: [$injector:unpr] Unknown provider: aProvider <- a <- $http <- $templateFactory <- $view <- $state NEW UPDATE finally i get the error after i minify and…
1
vote
1 answer

Gulp babel with babel-preset-react not transforming JSX code

I'm having issue to compile react jsx code with gulp. Here is what my gulpfile.js looks like - const gulp = require('gulp'); const babel = require('gulp-babel'); gulp.task('js', () => { return gulp.src('src/main.js') .pipe(babel({ …
HADI
  • 2,829
  • 1
  • 26
  • 26
1
vote
1 answer

Is it possible to run a build in browserify/babel against a certain browser target?

Looking at tables such as these: http://kangax.github.io/compat-table/es6/ It looks like Chrome is really close to supporting a lot of ES6, meaning (in my mind) that I should be able to drop the following during development: var babelifyOptions = { …
Chris
  • 54,599
  • 30
  • 149
  • 186
1
vote
2 answers

Unexpected token { when trying gulp with JS ES6

Am I using wrong version of some package or can you post me a link to the detailed tutorial or codepen where this syntax construction do not give me an error? I am getting this error: $ gulp D:\GIT\project02\gulpfile.js:20 const { COMPATIBILITY,…
1
vote
1 answer

gulp-babel get syntax error after removed node_modules and run npm install again

I have gulp-babel task in my gulp build script and it was working well until I removed the node_modules directory and run npm install again. It returned SyntaxError: j.js: Unexpected token (790:10) and the error log pointed the error token as…
LCB
  • 971
  • 9
  • 22
1
vote
0 answers

Uncaught SyntaxError: Unexpected token with gulp babel

I have my react component and right now when I startup the server via gulp, it throws this error... events.js:160 throw er; // Unhandled 'error' event ^ SyntaxError: /Users/Maude/Projects/NoteTaker/src/scripts/components/notes.jsx:…
Modelesq
  • 5,192
  • 20
  • 61
  • 88
0
votes
1 answer

Connecting files via import does not work

For a day now, I can not understand why babel for gulp does not work for me, or I incorrectly connect the modules ... The error in the browser is like this: Uncaught ReferenceError: require is not defined at main.min.js:1 I connect the modules…
SineYlo
  • 85
  • 1
  • 1
  • 4
0
votes
1 answer

gulp-babel doesn't transpile from node_modules

I noticed that gulp-babel doesn't transpile my code from node_modules, only from src folder. I have the latest version of node and npm. Here are my setup. .babelrc { "presets": [ ["@babel/preset-env", { "modules": false …
levipadre
  • 569
  • 7
  • 31