- 关于文档
- 1. 概览
- 开始
- 2.1. 动机
- 2.2. webpack是什么
- 2.3. 安装
- 2.4. 用法
- 2.5. Require Modules
- 2.6. Vendor Modules
- 2.7. 使用 Loaders
- 2.8. 使用 Plugins
- 2.9. 工具
- 2.10. 故障处理
- 教程与例子
- 指南
- webpack with
- Lists
- Development
- 7.1. Changelog
- 7.2. Roadmap
- 7.3. Ideas
- 7.4. Contributing
- Published with GitBook
webpack doc
extension | semantic | loader examples |
---|---|---|
.js | returns module exports | path-replace-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 |
.jade | returns template function | jade-loader |
.hbs
.handlebars | returns template function | handlebars-loader |