Skip to content

Commit 11a04f9

Browse files
committed
fix: make craco options actual
1 parent af77597 commit 11a04f9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/react-app-alias-ex/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ function aliasWebpack(options) {
139139

140140
const CracoAliasPlugin = {
141141
overrideWebpackConfig: function({webpackConfig, pluginOptions}) {
142-
return aliasWebpack(pluginOptions.alias||configPaths())(webpackConfig)
142+
return aliasWebpack(pluginOptions)(webpackConfig)
143143
},
144144
overrideJestConfig: function({jestConfig, pluginOptions}) {
145-
return aliasJest(pluginOptions.alias||configPaths())(jestConfig)
145+
return aliasJest(pluginOptions)(jestConfig)
146146
}
147147
}
148148

packages/react-app-alias/src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function checkOutside(aliasMap) {
6464
}, false)
6565
if(outside) {
6666
console.error(
67-
`https://github.com/oklas/react-app-rewire-alias#outside-of-root`
67+
`https://github.com/oklas/react-app-alias#outside-of-root`
6868
)
6969
process.exit(-1)
7070
}
@@ -112,7 +112,7 @@ function configFilePath(configPath = '') {
112112

113113
function configPathsRaw(confPath) {
114114
if(!confPath)
115-
throw Error('react-app-rewire-alias:configPaths: there is no config file found')
115+
throw Error('react-app-alias:configPaths: there is no [ts|js]config file found')
116116

117117
const confdir = path.dirname(confPath)
118118
const conf = require(confPath)
@@ -172,10 +172,10 @@ function aliasMapForJest(aliasMap) {
172172

173173
const CracoAliasPlugin = {
174174
overrideWebpackConfig: function({webpackConfig, pluginOptions}) {
175-
return aliasWebpack(pluginOptions.alias||configPaths())(webpackConfig)
175+
return aliasWebpack(pluginOptions)(webpackConfig)
176176
},
177177
overrideJestConfig: function({jestConfig, pluginOptions}) {
178-
return aliasJest(pluginOptions.alias||configPaths())(jestConfig)
178+
return aliasJest(pluginOptions)(jestConfig)
179179
}
180180
}
181181

0 commit comments

Comments
 (0)