Loader Conventions
extension | semantic | loader examples |
---|---|---|
.js |
returns module exports | babel-loader |
.ts |
returns module exports | ts-loader |
.coffee |
returns module exports |
coffee-loader coffee-redux-loader
|
.jsx |
returns module exports (react component) |
jsx-loader react-hot-loader!jsx-loader
|
.json .json5
|
returns json value |
json-loader json5-loader
|
.txt |
return string value | raw-loader |
.css |
returns nothing, side effect of adding style to DOM |
style-loader!css-loader style-loader!css-loader!autoprefixer-loader
|
.less |
returns nothing, side effect of adding style to DOM | style-loader!css-loader!less-loader |
.scss |
returns nothing, side effect of adding style to DOM | style-loader!css-loader!scss-loader |
.styl |
returns nothing, side effect of adding style to DOM | style-loader!css-loader!stylus-loader |
.png .jpg .jpeg .gif .svg
|
returns url to image |
file-loader url-loader
|
.woff .ttf
|
returns url to font |
file-loader url-loader
|
.wav .mp3
|
returns url to audio |
file-loader url-loader
|
.mpeg .mp4 .webm .ogv
|
returns url to video | file-loader |
.html |
returns HTML as string | html-loader |
.md .markdown
|
returns HTML as string | html-loader!markdown-loader |
.pug .jade
|
returns template function | pug-loader |
.hbs .handlebars
|
returns template function | handlebars-loader |
© 2012–2015 Tobias Koppers
Licensed under the MIT License.
https://webpack.github.io/docs/loader-conventions.html