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
28
votes
3 answers

ES6 import module with Gulp

I am trying to import my ES6 module into a file and running Gulp to concat and minify the file. I'm running into a ReferenceError: require is not defined at all.js(transpiled) line no 3. I have transpiled the code using gulp-babel. My js files…
Neil
  • 2,802
  • 8
  • 34
  • 49
12
votes
1 answer

Remove Global "use strict' from babel-preset-env

I want to remove the global 'use strict' that babel-preset-env adds with babel 6.x. I read the other post about es2015. I've tried the following .babelrc configuration, to no avail: { "presets": [["env", {"loose":true}]], "plugins": [ …
Captainlonate
  • 4,878
  • 4
  • 25
  • 35
8
votes
1 answer

gulp-babel don't produce any output file or doesn't work properly

I'm working on a JS library and I want to transpile all javascript code written in ES6 to ES5 standard to get more support in current browsers. The thing is I want to use Babel with the Gulp tasks, so I've installed all this NPM packages…
Yulio Aleman Jimenez
  • 1,642
  • 3
  • 17
  • 33
6
votes
1 answer

Babel throws a type error when exporting aggregates

When running my gulp task, I get the following error: SyntaxError in plugin "gulp-babel" Message: /Users/******/Repos/******/src/scripts/config/index.js: Unexpected export specifier type > 1 | export * as constants from './constants'; …
Paulos3000
  • 3,355
  • 10
  • 35
  • 68
5
votes
2 answers

Babel 7: Function.prototype.toString: 'this' is not a Function object

I'd like to create web components that should work on ie11. I'm compiling js with gulp (and gulp-babel, that includes babel 7). By now, when I compile with Babel, it works in Chrome, but sends an error in ie11: Function.prototype.toString: 'this' is…
Kateriine
  • 69
  • 1
  • 7
5
votes
1 answer

Issue with Babel and typeahead

While working with babel in a node.js project, I'm trying to bundle all my files into a single transpiled and minified js file. I'm running babel with gulp-babel 6.1.2, I've installed ES-2015 preset (6.13.2). I'm building a bundle with my files, and…
Guillermo
  • 1,493
  • 3
  • 16
  • 35
4
votes
1 answer

`babel-preset-react` not transforming jsx with gulp

No matter what I try, something like
is not being transformed to React.createClass and the browser just obviously chokes on the first < in my code. I'm using gulp like: return gulp.src(files) .pipe(babel({ presets: [ "react",…
4
votes
0 answers

Gulp and babel are extremely slow

I'm having issues with gulp and to a greater extent, babel, running extremely slow. It literally takes 2-4 minutes to process 3 javascript files. Even when I just run gulp it seems to take at least 10 seconds to start up, not sure why. Here are the…
Dustin
  • 4,314
  • 12
  • 53
  • 91
4
votes
1 answer

Using Gulp-babel and getting "Argument name clash in strict mode"

I'm trying to use gulp-babel so I can start writing some ES6 / ES2015 code inside of my ES5 app. var gulp = require('gulp'), gutil = require('gulp-util'), gulpif = require('gulp-if'), uglify =…
Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
3
votes
0 answers

Using gulp-babel to transpile ES6 from @Material components

I am working through a @Material tutorial here and am running into an issue with transpiling the ES6 code. I previously built the project using Gulp as my task runner and am wondering if I should just use webpack instead for the bundling…
sleepy_daze
  • 521
  • 2
  • 7
  • 24
3
votes
1 answer

Cannot resolve Babel plugins with Babel loader and Webpack

I have the following Webpack config: { resolveLoader: { root: path.join(__dirname, 'node_modules') }, module: { loaders: [ { test: /\.es6?$/, exclude: /node_modules/, …
wintercounter
  • 7,500
  • 6
  • 32
  • 46
2
votes
2 answers

Gulp & Babel polyfill Promises for IE11 issue

I have an old project written in Angular.js. I need to polyfill promises for IE11 but it's not working. In gulpfile.js I have requires for Babel stuff var corejs = require('core-js/stable'), regenerator = require('regenerator-runtime/runtime'), …
2
votes
1 answer

Why is babeljs.io output different than gulp-babel output?

Background I am trying to transpile my ES6 js to ES5 js. When I visit the https://babeljs.io/repl webpage to test out what babel should output for the preset option es2015 it outputs JavaScript that is different than what gulp-babel outputs. Input…
Nicholas Adamou
  • 711
  • 10
  • 23
2
votes
1 answer

gulp-babel with babel-preset-env ignores browserslist

I'm trying to transpile some ES2015 code with Babel using gulp-babel but Babel seems to ignore my browserslist. Babel transpiles some modern features, but not all that would be needed to target the specified browser. In my minimal example I use…
Fredrik P
  • 682
  • 1
  • 8
  • 21
2
votes
3 answers

gulp-babel and the strict mode

I use the "gulp-babel" before uglifying my js files. The module blocks the minification because a third party js script is not "strict mode" compilant. // Include gulp var gulp = require('gulp'); var baseDir = "./"; var jsources = [ …
serge
  • 13,940
  • 35
  • 121
  • 205
1
2 3 4