How to set up Grunt, Webpack and Babel

So I'm wondering what are the best practices for integrating Babel and Webpack with Grunt. There is a grunt-babel plugin, a grunt-webpack plugin, and babel-loader for Webpack. Should Babel be configured in Webpack or in Grunt configuration?

Initial development is killing me.

+7
ecmascript-6 webpack babeljs gruntjs
source share
1 answer

I also struggled with this some time ago, but managed to find a working solution for me and my team.

Is it possible to configure Babel in Webpack or in a Grunt configuration?

It’s good that it’s completely, but all that you decide: stick to it. Do not tune something there and another instrument elsewhere. Do it either completely in Webpack or Grunt.

Since all the configurations of my projects are done in Gruntfile.js , it was convenient for me to define Babel (or all my plugins in general) there. Splitting it into multiple files is just confusing .

If someone can try a different workflow with grunt-browserify using Babel and Grunt, I wrote a little ES6 template on how to set up the appropriate project.

+2
source share

All Articles