Skip to content

Commit f5e59b9

Browse files
authored
docs: migration to options
1 parent f70d991 commit f5e59b9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/migration.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
+ const {aliasWebpack} = require('react-app-alias')
1919
```
2020

21+
If dangerous mode is not used, scroll dow through next section to continue.
22+
2123
### Dangerous mode
2224

2325
Dangerous mode is renamed to extended/extremal and the implementation
@@ -41,4 +43,22 @@ is moved to separated liblrary with suffix **`-ex`**.
4143
+ const {aliasWebpack} = require('react-app-alias-ex')
4244
```
4345

46+
### Options
47+
48+
Before the agrument of `aliasWebpack()` and `aliasJest()` was alias map.
49+
Now the argument of these functions is options.
50+
Alias map now is `alias` option. So replace:
4451

52+
```diff
53+
const aliasMap = configPaths("./tsconfig.paths.json")
54+
// or possible alias map created in code
55+
const aliasMap = {
56+
'@app': 'src/app',
57+
'@lib': 'lib',
58+
}
59+
60+
- module.exports = aliasWebpack(aliasMap)
61+
- module.exports.jest = aliasJest(aliasMap)
62+
+ module.exports = aliasWebpack({alias: aliasMap})
63+
+ module.exports.jest = aliasJest({alias: aliasMap})
64+
```

0 commit comments

Comments
 (0)