Skip to content
This repository was archived by the owner on Dec 22, 2020. It is now read-only.

Commit 4fff4c3

Browse files
niedzielskievilebottnawi
authored andcommitted
docs: update config usage for Webpack v4 (#44)
1 parent e760d1b commit 4fff4c3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $ npm install json5-loader --save-dev
2929

3030
You can use the loader either:
3131

32-
- by configuring the `json5-loader` in the `module.loaders` object of the webpack configuration, or
32+
- by configuring the `json5-loader` in the `module.rules` object of the webpack configuration, or
3333
- by directly using the `json5-loader!` prefix to the require statement.
3434

3535
Suppose we have the following `json5` file:
@@ -44,7 +44,7 @@ Suppose we have the following `json5` file:
4444
}
4545
```
4646

47-
### Usage with preconfigured loader
47+
### Usage with preconfigured rule
4848

4949
**webpack.config.js**
5050

@@ -56,11 +56,12 @@ module.exports = {
5656
/* ... */
5757
},
5858
module: {
59-
loaders: [
59+
rules: [
6060
{
6161
// make all files ending in .json5 use the `json5-loader`
6262
test: /\.json5$/,
63-
loader: 'json5-loader',
63+
use: 'json5-loader',
64+
type: 'javascript/auto'
6465
},
6566
],
6667
},

0 commit comments

Comments
 (0)