Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新版本css loader bugfix #23

Merged
merged 5 commits into from
Feb 21, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
新版css loader bugfix
  • Loading branch information
joriewong committed Feb 21, 2017
commit 662b7d8cca03d4e1f6cea7774cff178aa67696ff
6 changes: 3 additions & 3 deletions content/loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ body { background: yellow; }
修改 entry.js:

```js
require("!style!css!./style.css") // 载入 style.css
require("!style-loader!css-loader!./style.css") // 载入 style.css
document.write('It works.')
document.write(require('./module.js'))
```
Expand All @@ -56,10 +56,10 @@ npm install css-loader style-loader
将 entry.js 中的 `require("!style!css!./style.css")` 修改为 `require("./style.css")` ,然后执行:

```bash
$ webpack entry.js bundle.js --module-bind 'css=style!css'
$ webpack entry.js bundle.js --module-bind 'css=style-loader!css-loader'

# 有些环境下可能需要使用双引号
$ webpack entry.js bundle.js --module-bind "css=style!css"
$ webpack entry.js bundle.js --module-bind "css=style-loader!css-loader"
```

显然,这两种使用 loader 的方式,效果是一样的。