- Replace library name for generic mode
- const {...} = require('react-app-rewire-alias')
+ const {...} = require('react-app-alias')
- Rename function
alias
toaliasWebpack
- const {alias} = require('react-app-alias')
+ const {aliasWebpack} = require('react-app-alias')
If dangerous mode is not used, scroll dow through next section to continue.
Dangerous mode is renamed to extended/extremal and the implementation
is moved to separated liblrary with suffix -ex
.
- Replace library name for dangerous mode,
- Remove
/lib/aliasDangerous
path part from import, - Notice that library name is different (suffix
-ex
added),
- const {...} = require('react-app-rewired-alias/lib/aliasDangerous')
+ const {...} = require('react-app-alias-ex')
-
For dangerous mode function
aliasDangerous
forreact-app-rewired
orcustomize-cra
is renamed toaliasWebpack
(also same as functionalias
for generic mode). -
Rename function
alias
toaliasWebpack
- const {aliasDangerous} = require('react-app-alias-ex')
+ const {aliasWebpack} = require('react-app-alias-ex')
Before the agrument of aliasWebpack()
and aliasJest()
was alias map.
Now the argument of these functions is options.
Alias map now is alias
option. So replace:
const aliasMap = configPaths("./tsconfig.paths.json")
// or possible alias map created in code
const aliasMap = {
'@app': 'src/app',
'@lib': 'lib',
}
- module.exports = aliasWebpack(aliasMap)
- module.exports.jest = aliasJest(aliasMap)
+ module.exports = aliasWebpack({alias: aliasMap})
+ module.exports.jest = aliasJest({alias: aliasMap})
Fucntion configPaths()
now become needed in rare cases. It is used internally.
Now you can specify path of tsconfig.json or jsconfig.json as an option.
- const aliasMap = configPaths("./tsconfig.paths.json")
- module.exports = aliasWebpack({alias: aliasMap})
+ module.exports = aliasWebpack({tsconfig: "./tsconfig.paths.json"})
If you uses standart name of these files you can skip it. It will be opned automatically.
- const aliasMap = configPaths("./jsconfig.paths.json")
- module.exports = aliasWebpack({jsconfig: "./jsconfig.paths.json"})
+ module.exports = aliasWebpack({})