generated from felipe-gustavo/cra-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-overrides.js
35 lines (28 loc) · 862 Bytes
/
config-overrides.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
/* eslint-disable no-param-reassign, @typescript-eslint/no-var-requires */
const TsConfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const removePlugins = ["ESLintWebpackPlugin", "ModuleScopePlugin"];
/**
* @param {import("webpack").Configuration} config
* @param {'development' | 'production'} env
*/
function webpack(config) {
config.plugins = config.plugins.filter(
(plugin) => !removePlugins.includes(plugin.constructor.name)
);
config.resolve.plugins.push(
new TsConfigPathsPlugin({ configFile: "./tsconfig.json" })
);
config.resolve.fallback = { ...config.resolve.fallback, crypto: false };
return config;
}
/**
* @param {import("ts-jest/dist/types").InitialOptionsTsJest} config
* @param {'development' | 'production'} env
*/
function jest(config) {
return config;
}
module.exports = {
webpack,
jest,
};