Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit 9fdd47e

Browse files
committedNov 16, 2016
Add -loader suffix to README to reflect new loader syntax webpack 2 requirement
1 parent 162c8fa commit 9fdd47e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed
 

‎README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)
66

77
``` javascript
8-
var url = require("file!./file.png");
8+
var url = require("file-loader!./file.png");
99
// => emits file.png as file in the output directory and returns the public url
1010
// => returns i. e. "/public-path/0dcbbaa701328a3c262cfd45869e351f.png"
1111
```
@@ -17,7 +17,7 @@ By default a file is emitted, however this can be disabled if required (e.g. for
1717
side packages).
1818

1919
``` javascript
20-
var url = require("file?emitFile=false!./file.png");
20+
var url = require("file-loader?emitFile=false!./file.png");
2121
// => returns the public url but does NOT emit a file
2222
// => returns i. e. "/public-path/0dcbbaa701328a3c262cfd45869e351f.png"
2323
```
@@ -44,27 +44,27 @@ use `?name=[path][name].[ext]`.
4444
## Examples
4545

4646
``` javascript
47-
require("file?name=js/[hash].script.[ext]!./javascript.js");
47+
require("file-loader?name=js/[hash].script.[ext]!./javascript.js");
4848
// => js/0dcbbaa701328a3c262cfd45869e351f.script.js
4949

50-
require("file?name=html-[hash:6].html!./page.html");
50+
require("file-loader?name=html-[hash:6].html!./page.html");
5151
// => html-109fa8.html
5252

53-
require("file?name=[hash]!./flash.txt");
53+
require("file-loader?name=[hash]!./flash.txt");
5454
// => c31e9820c001c9c4a86bce33ce43b679
5555

56-
require("file?name=[sha512:hash:base64:7].[ext]!./image.png");
56+
require("file-loader?name=[sha512:hash:base64:7].[ext]!./image.png");
5757
// => gdyb21L.png
5858
// use sha512 hash instead of md5 and with only 7 chars of base64
5959

60-
require("file?name=img-[sha512:hash:base64:7].[ext]!./image.jpg");
60+
require("file-loader?name=img-[sha512:hash:base64:7].[ext]!./image.jpg");
6161
// => img-VqzT5ZC.jpg
6262
// use custom name, sha512 hash instead of md5 and with only 7 chars of base64
6363

64-
require("file?name=picture.png!./myself.png");
64+
require("file-loader?name=picture.png!./myself.png");
6565
// => picture.png
6666

67-
require("file?name=[path][name].[ext]?[hash]!./dir/file.png")
67+
require("file-loader?name=[path][name].[ext]?[hash]!./dir/file.png")
6868
// => dir/file.png?e43b20c069c4a01867c31e98cbce33c9
6969
```
7070

0 commit comments

Comments
 (0)
This repository has been archived.