Skip to content

Commit

Permalink
fix: make craco options actual
Browse files Browse the repository at this point in the history
  • Loading branch information
oklas committed Mar 8, 2022
1 parent af77597 commit 11a04f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/react-app-alias-ex/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ function aliasWebpack(options) {

const CracoAliasPlugin = {
overrideWebpackConfig: function({webpackConfig, pluginOptions}) {
return aliasWebpack(pluginOptions.alias||configPaths())(webpackConfig)
return aliasWebpack(pluginOptions)(webpackConfig)
},
overrideJestConfig: function({jestConfig, pluginOptions}) {
return aliasJest(pluginOptions.alias||configPaths())(jestConfig)
return aliasJest(pluginOptions)(jestConfig)
}
}

Expand Down
8 changes: 4 additions & 4 deletions packages/react-app-alias/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function checkOutside(aliasMap) {
}, false)
if(outside) {
console.error(
`https://github.com/oklas/react-app-rewire-alias#outside-of-root`
`https://github.com/oklas/react-app-alias#outside-of-root`
)
process.exit(-1)
}
Expand Down Expand Up @@ -112,7 +112,7 @@ function configFilePath(configPath = '') {

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

const confdir = path.dirname(confPath)
const conf = require(confPath)
Expand Down Expand Up @@ -172,10 +172,10 @@ function aliasMapForJest(aliasMap) {

const CracoAliasPlugin = {
overrideWebpackConfig: function({webpackConfig, pluginOptions}) {
return aliasWebpack(pluginOptions.alias||configPaths())(webpackConfig)
return aliasWebpack(pluginOptions)(webpackConfig)
},
overrideJestConfig: function({jestConfig, pluginOptions}) {
return aliasJest(pluginOptions.alias||configPaths())(jestConfig)
return aliasJest(pluginOptions)(jestConfig)
}
}

Expand Down

0 comments on commit 11a04f9

Please sign in to comment.