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.
raw-loader
Loads raw content of a file (utf-8)val-loader
Executes code as module and consider exports as JS codeurl-loader
Works like the file loader, but can return a data URL if the file is smaller than a limitfile-loader
Emits the file into the output folder and returns the (relative) URLjson-loader
Loads a JSON file (included by default)json5-loader
Loads and transpiles a JSON 5 filecson-loader
Loads and transpiles a CSON filescript-loader
Executes a JavaScript file once in global context (like in script tag), requires are not parsedbabel-loader
Loads ES2015+ code and transpiles to ES5 using Babel
traceur-loader
Loads ES2015+ code and transpiles to ES5 using Traceur
ts-loader
or awesome-typescript-loader
Loads TypeScript 2.0+ like JavaScriptcoffee-loader
Loads CoffeeScript like JavaScripthtml-loader
Exports HTML as string, require references to static resourcespug-loader
Loads Pug templates and returns a functionjade-loader
Loads Jade templates and returns a functionmarkdown-loader
Compiles Markdown to HTMLposthtml-loader
Loads and transforms a HTML file using PostHTML
handlebars-loader
Compiles Handlebars to HTMLstyle-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 filestylus-loader
Loads and compiles a Stylus filepostcss-loader
Loads and transforms a CSS/SSS file using PostCSS
mocha-loader
Tests with mocha (Browser/NodeJS)eslint-loader
PreLoader for linting code using ESLint
jshint-loader
PreLoader for linting code using JSHint
jscs-loader
PreLoader for code style checking using JSCS
coverjs-loader
PreLoader to determine the testing coverage using CoverJS
vue-loader
Loads and compiles Vue Components
polymer-loader
Process HTML & CSS with preprocessor of choice and require()
Web Components like first-class modulesangular2-template-loader
Loads and compiles Angular ComponentsFor more third-party loaders, see the list from awesome-webpack.
© 2012–2016 Tobias Koppers
Licensed under the Creative Commons Attribution License 4.0.
https://webpack.js.org/loaders/