Loaders
Webpack enables use of loaders to preprocess files. This allows you to bundle any static resource way beyond JavaScript. You can easily write your own loaders using Node.js.
Loaders are activated by using loadername! prefixes in require() statements, or are automatically applied via regex from your webpack configuration – see configuration.
Files
ref-loaderCreate dependencies between any files manually
JSON
cson-loaderLoads and transpiles a CSON file
Transpiling
babel-loaderLoads ES2015+ code and transpiles to ES5 using Babelesbuild-loaderLoads ES2015+ code and transpiles to ES6+ using esbuildbuble-loaderLoads ES2015+ code and transpiles to ES5 using Bublétraceur-loaderLoads ES2015+ code and transpiles to ES5 using Traceurts-loaderLoads TypeScript 2.0+ like JavaScriptcoffee-loaderLoads CoffeeScript like JavaScriptfengari-loaderLoads Lua code using fengarielm-webpack-loaderLoads Elm like JavaScript
Templating
html-loaderExports HTML as string, require references to static resourcespug-loaderLoads Pug and Jade templates and returns a functionmarkdown-loaderCompiles Markdown to HTMLreact-markdown-loaderCompiles Markdown to a React Component using the markdown-parse parserposthtml-loaderLoads and transforms a HTML file using PostHTMLhandlebars-loaderCompiles Handlebars to HTMLmarkup-inline-loaderInline SVG/MathML files to HTML. It’s useful when applying icon font or applying CSS animation to SVG.twig-loaderCompiles Twig templates and returns a functionremark-loaderLoad markdown throughremarkwith built-in image resolution
Styling
style-loaderAdd exports of a module as style to DOMcss-loaderLoads CSS file with resolved imports and returns CSS codeless-loaderLoads and compiles a LESS filesass-loaderLoads and compiles a SASS/SCSS filepostcss-loaderLoads and transforms a CSS/SSS file using PostCSSstylus-loaderLoads and compiles a Stylus file
Frameworks
vue-loaderLoads and compiles Vue Componentsangular2-template-loaderLoads and compiles Angular Components
Awesome
For more third-party loaders, see the list from awesome-webpack.
Next »
babel-loader
