forked from alirezahematidev/jalaali-react-date-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
54 lines (42 loc) · 1.3 KB
/
config-overrides.js
File metadata and controls
54 lines (42 loc) · 1.3 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
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
const resolvePath = (relativePath) => path.resolve(__dirname, relativePath);
const excludes = `node_modules/(.*)`;
const includes = [resolvePath("./src/core/styles/index.css")];
module.exports = {
webpack: (config) => {
config.module.rules[0].include = includes;
config.module.rules[0].exclude = excludes;
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ["@svgr/webpack"],
});
config.module.rules.push({
test: /\.css$/i,
use: {
loader: ["style-loader", "css-loader"],
},
});
config.module.rules.push({
test: /\.(woff|woff2|eot|ttf|otf)$/i,
use: ["url-loader?limit=100000"],
});
return config;
},
jest: function (config) {
config.testPathIgnorePatterns = [".*/dist/.*", "dist"];
config.transformIgnorePatterns = ["/node_modules/"];
config.moduleNameMapper = {
...config.moduleNameMapper,
"^lodash-es$": "lodash",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js",
};
return config;
},
paths: function (paths) {
return paths;
},
};