what is the different between webpack loader and babel-plugin?

1.2k views Asked by At

In my opinion, webpack-loader has the same function as babel-plugin!!

So can you help me answer the difference between the two, isn't it all through the AST to manipulate the code?

1

There are 1 answers

0
ObinasBaba On

Babel: will turn your ES6+ code into ES5 friendly code, so you can start using it right now without waiting for browser support;

Webpack: A bundler for javascript and friends Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through "loaders" modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ..., and your custom stuff.

Simply put, Webpack is a tool for putting your code through the processing pipeline and bundling it together into a single JavaScript file.

Babel can be classified as a tool in the "JavaScript Compilers" category, while Webpack is grouped under "JS Build Tools / JS Task Runners"

For More clarification see this answer Webpack loaders vs plugins; what's the difference?

Also check out this Medium post Webpack explained simply