From f2e291ce14c7bb218465c9d13bed7955a34be359 Mon Sep 17 00:00:00 2001 From: Michael Ciniawsky Date: Sat, 22 Jul 2017 11:29:06 +0200 Subject: [PATCH] docs(README): revert usage instructions (`webpack =< v1.0.0`) --- README.md | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index ba96673..199d625 100644 --- a/README.md +++ b/README.md @@ -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**

Usage

+### `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'; -``` -

Maintainer

@@ -76,6 +65,7 @@ import json from 'json-loader!file.json';
+ [npm]: https://img.shields.io/npm/v/json-loader.svg [npm-url]: https://npmjs.com/package/json-loader