-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcraco.config.js
More file actions
73 lines (72 loc) · 2.38 KB
/
Copy pathcraco.config.js
File metadata and controls
73 lines (72 loc) · 2.38 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const path = require('path');
module.exports = {
webpack: {
devtool: 'source-map',
alias: {
'@context': path.resolve(__dirname, 'src/shared/context'),
'@navigation': path.resolve(__dirname, 'src/navigation'),
'@tests': path.resolve(__dirname, 'src/tests'),
'@pages': path.resolve(__dirname, 'src/pages'),
'@assets': path.resolve(__dirname, 'src/shared/assets'),
'@components': path.resolve(__dirname, 'src/shared/components'),
'@hooks': path.resolve(__dirname, 'src/shared/hooks'),
'@store': path.resolve(__dirname, 'src/shared/store'),
'@constants': path.resolve(__dirname, 'src/shared/constants'),
'@lib': path.resolve(__dirname, 'src/shared/lib'),
'@types': path.resolve(__dirname, 'src/shared/types'),
},
configure: {
module: {
rules: [
{
test: /\.svg$/,
use: ['@svgr/webpack'],
},
],
},
},
},
jest: {
configure: {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
moduleNameMapper: {
'^@pages/(.*)$': '<rootDir>/src/pages/$1',
'^@navigation$': '<rootDir>/src/navigation',
'^@tests$': '<rootDir>/src/tests',
'^@assets/(.*)$': '<rootDir>/src/shared/assets/$1',
'^@components$': '<rootDir>/src/shared/components',
'^@hooks$': '<rootDir>/src/shared/hooks',
'^@store$': '<rootDir>/src/shared/store',
'^@constants$': '<rootDir>/src/shared/constants',
'^@lib$': '<rootDir>/src/shared/lib',
'^@context$': '<rootDir>/src/shared/context',
'^@types$': '<rootDir>/src/shared/types',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(png|svg)$': '<rootDir>/src/tests/mocks/fileMock.js',
},
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.json',
},
],
},
// transformIgnorePatterns: ["node_modules/(?!(react-router-dom)/)"],
// testMatch: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.json',
},
},
},
},
devServer: {
client: {
overlay: false, // Just hiding runtime error dialog
},
},
};