From the course: Learning webpack 4

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

What is a loader?

What is a loader?

From the course: Learning webpack 4

Start my 1-month free trial

What is a loader?

- [Instructor] webpack loaders can help us perform transformations on files. They can help with the loading of files and images, and webpack loaders are commonly used when using different dialects of JavaScript. For example, many React applications use JSX, or JavaScript as XML, to create user interface components. JSX doesn't run natively in the browser. It must be first transformed into plain JavaScript. You also may be using ECMAScript6, or ECMAScripts 2016, 2017 or even 2018. So not all browsers support all of the newest features without a transform. So like JSX, ECMAScript is often compiled into plan JavaScript prior to being loaded into the browser. The tool most commonly used for transformation of JSX and ES6 is Babel. When we use the Babel loader in webpack projects, we tell webpack to use Babel to perform these transformations on certain types of files. JSX and ES6 go in, get transpiled, and plain JavaScript comes out. For a full list of webpack loaders, you can check out the…

Contents