This repository was archived by the owner on Aug 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 125
loader conventions
Timothy Gu edited this page Jul 25, 2016
·
10 revisions
| extension | semantic | loader examples |
|---|---|---|
.js |
returns module exports | babel-loader |
.ts |
returns module exports | ts-loader |
.coffee |
returns module exports |
coffee-loadercoffee-redux-loader
|
.jsx |
returns module exports (react component) |
jsx-loaderreact-hot-loader!jsx-loader
|
.json.json5
|
returns json value |
json-loaderjson5-loader
|
.txt |
return string value | raw-loader |
.css |
returns nothing, side effect of adding style to DOM |
style-loader!css-loaderstyle-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-loaderurl-loader
|
.woff.ttf
|
returns url to font |
file-loaderurl-loader
|
.wav.mp3
|
returns url to audio |
file-loaderurl-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 |
webpack 👍