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

Commit

Permalink
docs(README): revert usage instructions (webpack =< v1.0.0) (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-ciniawsky authored and joshwiens committed Jul 22, 2017
1 parent d34395a commit 5bb09bb
Showing 1 changed file with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,36 @@
npm install --save-dev json-loader
```

⚠️ **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.**
> ⚠️ **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**
<h2 align="center">Usage</h2>

### `Inline`

### Configuration (recommended)
```js
const json = require('json-loader!./file.json');
```

### `Configuration` (recommended)

```js
const json = require('./file.json');
```

**webpack.config.js**
```js
module.exports = {
module: {
rules: [
loaders: [
{
test: /\.json$/,
use: 'json-loader'
loader: 'json-loader'
}
]
}
}
```

```js
import json from 'file.json';
```

### CLI

```bash
webpack --module-bind 'json=json-loader'
```

```js
import json from 'file.json';
```

### Inline

```js
import json from 'json-loader!file.json';
```

<h2 align="center">Maintainer</h2>

<table>
Expand All @@ -76,6 +65,7 @@ import json from 'json-loader!file.json';
</tbody>
</table>


[npm]: https://img.shields.io/npm/v/json-loader.svg
[npm-url]: https://npmjs.com/package/json-loader

Expand Down

0 comments on commit 5bb09bb

Please sign in to comment.