-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
32 lines (29 loc) · 1.03 KB
/
config-overrides.js
File metadata and controls
32 lines (29 loc) · 1.03 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
const path = require("path");
const { override, disableEsLint, babelInclude } = require("customize-cra");
// https://github.com/arackaf/customize-cra
const configWebpackPlugins = () => config => {
// 太卡关闭一些插件
// 关闭`ESLINT`的插件 -> 在`VSCode`校验
// 关闭`CaseSensitivePathsPlugin`插件
// 关闭`IgnorePlugin`插件
config.plugins = config.plugins.filter(
plugin =>
plugin.constructor.name !== "ESLintWebpackPlugin" &&
plugin.constructor.name !== "CaseSensitivePathsPlugin" &&
plugin.constructor.name !== "IgnorePlugin"
);
config.resolve.plugins = config.resolve.plugins.filter(
plugin => plugin.constructor.name !== "ModuleScopePlugin"
);
return config;
};
const example = path.resolve(__dirname, "example");
const src = path.resolve(__dirname, "src");
module.exports = {
paths: function (paths) {
paths.appIndexJs = example;
paths.appSrc = example;
return paths;
},
webpack: override(babelInclude([src, example]), disableEsLint(), configWebpackPlugins()),
};