According to the Webpack documentation https://webpack.js.org/guides/getting-started/
Webpack is used to compile JavaScript modules. Once installed, you can interface with webpack either from its CLI or API.
But what does compile in this sense mean? JavaScript clearly isn't a compiled language so how can Webpack "compile" JavaScript modules? Should't it rather say bundling instead?
Webpack isn't a compiler it's a bundler, but like a compiler it parses your source files, Webpack bundles your code and you can set it up in a way that it also transpiles (transforms) newer JS syntax into older but more widely supported syntax and it also allows you to split your code into different modules using commonJS or es6 modules and bundle them together in a way that will make them work inside a browser in other words it compiles "source" (doesn't work in browsers) to "target" which is bundled and can be parsed as one program.
also most JavaScript engines nowadays use Just-in-time compilation meaning that JS is a compiled language, it's not compiled ahead-of-time but the engine parses your whole JS file then compiles and executes it chunk by chunk.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With