Questions tagged [grunt-babel]

Grunt plugin for Babel

26 questions
12
votes
1 answer

Grunt babel multiple files and preserve source mapping

I am trying, using grunt and babel, to transpile all js6 files in a folder and end up with a concatenated single file (js5) with a working sourcemap to the original es6 files. However the sourcemapping does not work. My babel, concat settings…
Todilo
  • 1,256
  • 3
  • 19
  • 38
7
votes
4 answers

Run javascript es6 code in Jasmine

I am exploring JavaScript es6 code in angularjs app and used grunt babel to compile the es6 to es5. My unit test (jasmine) doesn't run with es6 code using phantomjs. Whats best way to run test? Is there any plugin to use for jasmine to run es6 code?
svp
  • 495
  • 1
  • 12
  • 26
4
votes
2 answers

Grunt + Babel successfully runs but doesn't do anything

I'm rather new to grunt/npm but after reading up the docs. I have made myself a package.json and a Gruntfile.js. Here's my folder structure: / |- src |- myfile.es6 |- anotherfile.es6 |- etc. |- Gruntfile.js |- package.json What I…
Downgoat
  • 13,771
  • 5
  • 46
  • 69
3
votes
2 answers

grunt babel is not working

I'm trying to transpile es6 to es5 but it is not working. My Gruntfile.js module.exports = function(grunt){ "use strict"; grunt.loadNpmTasks('grunt-babel'); grunt.initConfig({ "babel": { options: { sourceMap: true …
Alessander França
  • 2,697
  • 2
  • 29
  • 52
2
votes
1 answer

grunt-babel is not transpiling parent folder react jsx files

I am using grunt to transpiling react jsx files and it's perfectly works as expected by using grunt-babel along with presets: ["env", "react"],plugins: ["transform-es2015-modules-amd"] The problem I have is,grunt-babel transpiling JSX files which…
Jayavel
  • 3,377
  • 2
  • 21
  • 35
2
votes
0 answers

Browserify + babelify cannot find module

Hi I'm trying to transform js code into something that browser can execute. utils/Logger.js 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor =…
Ismael Moral
  • 722
  • 1
  • 9
  • 35
2
votes
1 answer

grunt-babel breaks file formatting (new lines and spaces)

I've just started using babel with grunt-babel in my application. But I encounter some behavior I want to avoid: Before babel: (function() { 'use strict'; angular .module('app') .controller('Ctrl', Ctrl); Ctrl.$inject =…
Serhii Holinei
  • 5,758
  • 2
  • 32
  • 46
1
vote
1 answer

Make ES6 Internet Explorer 11 compliant using Grunt-Babel

I installed grunt-babel in order to allow IE 11 users on our site. Right now the site is broken for those users. I've been mostly successful except I've gotten the following error that I don't know how to address. ReferenceError: regeneratorRuntime…
1
vote
0 answers

Minified file breaks angular

So I'm working on an older solution where we're on Angular 1.6. I decided to make it somewhat more up to date by adding using ES6. We're using grunt as a task runner so I introduced babel as a watch-task, where I add transpiled files to its own dir.…
1
vote
1 answer

grunt-babel hangs and doesn't return error message

I am trying to compile my es6 to es5 with grunt-babel. When I enter grunt babel into the command line, it hangs and never runs babel. It doesn't return an error or crash it just hangs. I have other tasks in my Gruntfile.js and they run just fine, so…
CascadiaJS
  • 2,320
  • 2
  • 26
  • 46
1
vote
0 answers

How to use source maps with grunt-babel from grunt-contrib-concat

I have set up some automation via grunt, using grunt-contrib-concat (v 0.5.1) in the first and grunt-babel (v 6.0.0) in second step. If I use the option to generate source maps with concat, the options "embed" and "inline" raise the following error…
nininho
  • 138
  • 9
1
vote
1 answer

babel transpilation returns object instead of string or function

My Component code looks like below. import React, { Component, PropTypes } from 'react'; export default class HeroBanner extends Component { constructor(props) { super(props); } render() { const { columns, content } =…
Abhijeet Mishra
  • 443
  • 4
  • 13
1
vote
1 answer

How to understand Grunt task options

My goal is to run ES6 code on browser, and after reading a lot, I found this enter link description here and is able to run ES2015 code. But I am having a difficult time to create a Gruntfile.js, I don't understand what keywords are available and…
Maxi Wu
  • 1,274
  • 3
  • 20
  • 38
1
vote
1 answer

Grunt watch task failing to transpile ES6 code

I'm using grunt and grunt-babel to transpile ES6 code whenever I change an es6 file. However, it seems like I have an error in one of those files, as I get this message when I make a change Waiting... >> File "scripts/test.es6.js" changed. Running…
praks5432
  • 7,246
  • 32
  • 91
  • 156
0
votes
1 answer

Async await doesn't get compiled in Grunt

I am trying to compile my ES6+ code to vanilla js using Grunt task runner. I have purposely chosen Grunt over webpack and gulp because I just wanted to minify my js files. I have successfully compiled my ES6 code to vanilla after running the code…
Siddhant
  • 196
  • 2
  • 9
1
2