K
K
kova1ev2018-09-21 22:14:30
JavaScript
kova1ev, 2018-09-21 22:14:30

Do I need to use babel with webpack 4?

I'm a beginner, I watch different courses - everywhere they use webpack along with babel. But I try to build with a minimal webpack config and it transpiles the es6 code without any babel. I don’t understand why then install babel in the project, it’s like just a transpiler?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Egorov, 2018-09-22
@svupol

But I try to build with minimal webpack config

And what's the point? You just limit your functionality, the weight of the application does not depend on the number of webpack plugins, so it makes no sense.
It doesn't trap anything, it just assembles modules, babel is needed to transpile es6, 7, 8 -> es5 for example, it depends on the settings. That is, code written in ES6 will partially not work in IE11, but if you run it through Babel, then this code will work everywhere (again, depends on the settings you specified).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question