oklas / react-app-alias

:label: Alias and multiple src directory for craco or rewired create-react-app
MIT License
174 stars 18 forks source link

jest moduleNameMapper issue for file aliases #76

Closed indatawetrust closed 2 years ago

indatawetrust commented 2 years ago

hi, in use case like below

"paths": {
      "@app-utils": ["src/utility.js"]
 }

such a config occurs;

{
  '^@app-utils/(.*)$': '<rootDir>/src/utility.js/$1'
}

this config is not working correctly for jest. it has to be like this for it to work correctly

{
  '^@app-utils$': '<rootDir>/src/utility.js'
}
indatawetrust commented 2 years ago

fixes https://github.com/oklas/react-app-alias/pull/77