18
18
+ const {aliasWebpack} = require('react-app-alias')
19
19
```
20
20
21
+ If dangerous mode is not used, scroll dow through next section to continue.
22
+
21
23
### Dangerous mode
22
24
23
25
Dangerous mode is renamed to extended/extremal and the implementation
@@ -41,4 +43,40 @@ is moved to separated liblrary with suffix **`-ex`**.
41
43
+ const {aliasWebpack} = require('react-app-alias-ex')
42
44
```
43
45
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:
51
+
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
+ ```
65
+
66
+ Fucntion ` configPaths() ` now become needed in rare cases. It is used internally.
67
+ Now you can specify path of * tsconfig.json* or * jsconfig.json* as an option.
68
+
69
+ ``` diff
70
+ - const aliasMap = configPaths("./tsconfig.paths.json")
71
+ - module.exports = aliasWebpack({alias: aliasMap})
72
+ + module.exports = aliasWebpack({tsconfig: "./tsconfig.paths.json"})
73
+ ```
74
+
75
+ If you uses standart name of these files you can skip it. It will be opned automatically.
76
+
77
+ ``` diff
78
+ - const aliasMap = configPaths("./jsconfig.paths.json")
79
+ - module.exports = aliasWebpack({jsconfig: "./jsconfig.paths.json"})
80
+ + module.exports = aliasWebpack({})
81
+ ```
44
82
0 commit comments