-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcraco.config.ts
49 lines (47 loc) · 1.43 KB
/
craco.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import type { CracoConfig } from '@craco/types'
import path from 'path'
const config: CracoConfig = {
webpack: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
configure: (webpackConfig, { env, paths }) => {
webpackConfig.ignoreWarnings = [
{
module: /node_modules\/@react-stately/,
},
{
module: /node_modules\/@react-aria/,
},
{
module: /node_modules\/anondb/,
},
]
return webpackConfig
},
},
jest: {
configure: (jestConfig, { env, paths, resolve, rootDir }) => {
jestConfig.testEnvironmentOptions = {
url: 'http://localhost:8000',
}
jestConfig.moduleNameMapper = {
'@/(.*)$': '<rootDir>/src/$1',
'(.*)react-datepicker.css': '<rootDir>/empty-module.js',
}
jestConfig.transformIgnorePatterns = [
'node_modules/(?!@uidotdev/usehooks|nanoid|axios/)',
]
return jestConfig
},
},
eslint: {
configure: (eslintConfig, { env, paths }) => {
if (Array.isArray(eslintConfig.extends)) {
eslintConfig.extends.push('prettier')
}
return eslintConfig
},
},
}
export default config