Skip to content

Commit

Permalink
Fix: Make sure webpack and jest can resolve "rootDir" paths (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackw authored Oct 21, 2022
1 parent d3141bd commit 793cd99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

module.exports = {
modulePaths: ['<rootDir>/src'],
testEnvironment: 'jest-environment-jsdom',
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ const config = async (env): Promise<Configuration> => ({

resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
// handle resolving "rootDir" paths
modules: [path.resolve(process.cwd(), 'src'), 'node_modules'],
unsafeCache: true,
},
});
Expand Down

0 comments on commit 793cd99

Please sign in to comment.