-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcraco.config.js
48 lines (47 loc) · 1.52 KB
/
craco.config.js
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
const path = require('path');
const CracoAlias = require('craco-alias');
module.exports = {
reactScriptsVersion: 'react-scripts' /* (default value) */,
plugins: [
{
plugin: CracoAlias,
options: {
source: 'tsconfig',
baseUrl: './src',
tsConfigPath: './tsconfig.path.json',
},
},
],
typescript: {
enableTypeChecking: true /* (default value) */,
},
webpack: {
// 절대경로 지정
alias: {
'~api': path.resolve(__dirname, 'src/api'),
'~assets': path.resolve(__dirname, 'src/assets'),
'~components': path.resolve(__dirname, 'src/components'),
'~constants': path.resolve(__dirname, 'src/constants'),
'~hooks': path.resolve(__dirname, 'src/hooks'),
'~store': path.resolve(__dirname, 'src/store'),
'~styles': path.resolve(__dirname, 'src/styles'),
'~types': path.resolve(__dirname, 'src/types'),
'~utils': path.resolve(__dirname, 'src/utils'),
},
},
jest: {
configure: {
moduleNameMapper: {
'^\\~assets/(.*)$': '<rootDir>/src/assets/$1',
'^\\~api/(.*)$': '<rootDir>/src/api/$1',
'^\\~components/(.*)$': '<rootDir>/src/components/$1',
'^\\~constants/(.*)$': '<rootDir>/src/constants/$1',
'^\\~hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^\\~store/(.*)$': '<rootDir>/src/store/$1',
'^\\~styles/(.*)$': '<rootDir>/src/styles/$1',
'^\\~types/(.*)$': '<rootDir>/src/types/$1',
'^\\~utils/(.*)$': '<rootDir>/src/utils/$1',
},
},
},
};