Webpack enables use ofloaders 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 usingloadername!
prefixes inrequire()
statements, or are automatically applied via regex from your webpack configuration – seeconfiguration.
val-loader
Executes code as module and consider exports as JS coderef-loader
Create dependencies between any files manuallycson-loader
Loads and transpiles aCSON filebabel-loader
Loads ES2015+ code and transpiles to ES5 usingBabelesbuild-loader
Loads ES2015+ code and transpiles to ES6+ usingesbuildbuble-loader
Loads ES2015+ code and transpiles to ES5 usingBublétraceur-loader
Loads ES2015+ code and transpiles to ES5 usingTraceurts-loader
LoadsTypeScript 2.0+ like JavaScriptcoffee-loader
LoadsCoffeeScript like JavaScriptfengari-loader
Loads Lua code usingfengarielm-webpack-loader
LoadsElm like JavaScripthtml-loader
Exports HTML as string, require references to static resourcespug-loader
Loads Pug and Jade templates and returns a functionmarkdown-loader
Compiles Markdown to HTMLreact-markdown-loader
Compiles Markdown to a React Component using the markdown-parse parserposthtml-loader
Loads and transforms a HTML file usingPostHTMLhandlebars-loader
Compiles Handlebars to HTMLmarkup-inline-loader
Inline SVG/MathML files to HTML. It’s useful when applying icon font or applying CSS animation to SVG.twig-loader
Compiles Twig templates and returns a functionremark-loader
Load markdown throughremark
with built-in image resolutionstyle-loader
Add exports of a module as style to DOMcss-loader
Loads CSS file with resolved imports and returns CSS codeless-loader
Loads and compiles a LESS filesass-loader
Loads and compiles a SASS/SCSS filepostcss-loader
Loads and transforms a CSS/SSS file usingPostCSSstylus-loader
Loads and compiles a Stylus filevue-loader
Loads and compilesVue Componentsangular2-template-loader
Loads and compilesAngular ComponentsFor more third-party loaders, see the list fromawesome-webpack.