Webpack webpack.config.js vs webpack.config.babel.js file

402 views Asked by At

Can someone explain the difference between the webpack.config.js and webpack.config.babel.js files?

What are the required changes needed to be done to change between those two?

2

There are 2 answers

0
Javier Jaimes On

There are both Webpack Configuration files. Look at the Webpack Configuration doc and Webpack Configuration Concept.

You can have multiple configuration in your project and when you want to execute one of them you can use the flag --config CONFIG_FILE_NAME like webpack --config CONFIG_FILE_NAME.

So in your case:

webpack --config webpack.config.js or webpack --config webpack.config.babel.js

0
AlexMelw On

In case of webpack.config.babel.js, use ES6+

import x from y;

rather than ES5

var x = require(y);