Skip to content
This repository was archived by the owner on Aug 20, 2018. It is now read-only.

Commit 5bb09bb

Browse files
michael-ciniawskyjoshwiens
authored andcommitted
docs(README): revert usage instructions (webpack =< v1.0.0) (#56)
1 parent d34395a commit 5bb09bb

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

README.md

+14-24
Original file line numberDiff line numberDiff line change
@@ -21,47 +21,36 @@
2121
npm install --save-dev json-loader
2222
```
2323

24-
⚠️ **Note: Since webpack v2, importing of JSON files will work by default. You might still want to use this if you use a custom file extension.**
24+
> ⚠️ **Since `webpack >= v2.0.0`, importing of JSON files will work by default. You might still want to use this if you use a custom file extension. See the [v1.0.0 -> v2.0.0 Migration Guide](https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore) for more information**
2525
2626
<h2 align="center">Usage</h2>
2727

28+
### `Inline`
2829

29-
### Configuration (recommended)
30+
```js
31+
const json = require('json-loader!./file.json');
32+
```
33+
34+
### `Configuration` (recommended)
35+
36+
```js
37+
const json = require('./file.json');
38+
```
3039

3140
**webpack.config.js**
3241
```js
3342
module.exports = {
3443
module: {
35-
rules: [
44+
loaders: [
3645
{
3746
test: /\.json$/,
38-
use: 'json-loader'
47+
loader: 'json-loader'
3948
}
4049
]
4150
}
4251
}
4352
```
4453

45-
```js
46-
import json from 'file.json';
47-
```
48-
49-
### CLI
50-
51-
```bash
52-
webpack --module-bind 'json=json-loader'
53-
```
54-
55-
```js
56-
import json from 'file.json';
57-
```
58-
59-
### Inline
60-
61-
```js
62-
import json from 'json-loader!file.json';
63-
```
64-
6554
<h2 align="center">Maintainer</h2>
6655

6756
<table>
@@ -76,6 +65,7 @@ import json from 'json-loader!file.json';
7665
</tbody>
7766
</table>
7867

68+
7969
[npm]: https://img.shields.io/npm/v/json-loader.svg
8070
[npm-url]: https://npmjs.com/package/json-loader
8171

0 commit comments

Comments
 (0)