Skip to content

Commit d1ff6b3

Browse files
committed
docs: replace function alias with aliasWebpack #60
1 parent 271b506 commit d1ff6b3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ Now include this file in **extends** section, like this:
104104

105105
```js
106106
// config-overrides.js
107-
const {alias, configPaths} = require('react-app-rewire-alias')
107+
const {aliasWebpack, configPaths} = require('react-app-rewire-alias')
108108

109109
const aliasMap = configPaths('./tsconfig.paths.json') // or jsconfig.paths.json
110110

111-
module.exports = alias(aliasMap)
111+
module.exports = aliasWebpack(aliasMap)
112112
module.exports.jest = aliasJest(aliasMap)
113113
```
114114

@@ -182,17 +182,17 @@ and replace `react-scripts` in `package.json`:
182182

183183
#### API
184184

185-
* **alias(aliasMap)(webpackConfig)**
185+
* **aliasWebpack(aliasMap)(webpackConfig)**
186186

187-
The function `alias()` accepts aliases declared in form:
187+
The function `aliasWebpack()` accepts aliases declared in form:
188188

189189
```js
190190
const aliasMap = {
191191
example: 'example/src',
192192
'@library': 'library/src',
193193
}
194194

195-
module.exports = alias(aliasMap)
195+
module.exports = aliasWebpack(aliasMap)
196196
```
197197

198198
To make all things worked, aliases must be declared in `jsconfig.json` or `tsconfig.json`.
@@ -204,13 +204,13 @@ The result is a function which will modify Wepack config
204204
* **configPaths()**
205205

206206
The function `configPaths()` loads paths from file compatible with `jsconfig.json`
207-
or `tsconfig.json` and returns path in form acceptable for `alias()` function.
207+
or `tsconfig.json` and returns path in form acceptable for `aliasWebpack()` function.
208208
The `tsconfig.json` is prioritized over the `jsconfig.json` in the loading sequence.
209209

210210
```js
211211
const aliasMap = configPaths('./tsconfig.paths.json')
212212

213-
module.exports = alias(aliasMap)
213+
module.exports = aliasWebpack(aliasMap)
214214
```
215215

216216
* **extendability**
@@ -220,7 +220,7 @@ with another:
220220

221221
```js
222222
module.exports = function override(config) {
223-
const modifiedConfig = alias(...)(config)
223+
const modifiedConfig = aliasWebpack(...)(config)
224224
...
225225
return someElse(modifiedConfig)
226226
}

0 commit comments

Comments
 (0)