forked from Hacker0x01/react-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-overrides.js
26 lines (25 loc) · 899 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
const path = require("path");
const ModuleScopePlugin = require("react-dev-utils/ModuleScopePlugin");
module.exports = function override(config, env) {
//do stuff with the webpack config...
config.module.rules.push({
test: /\.js/,
include: path.resolve(__dirname, "src/examples"),
use: "raw-loader"
});
config.resolve.plugins = config.resolve.plugins.filter(
plugin => !(plugin instanceof ModuleScopePlugin)
);
// Enable it, so that our custom .eslintrc for the examples will work
for (let i = 0; i < config.module.rules.length; i++) {
if (Array.isArray(config.module.rules[i].use)) {
for (let j = 0; j < config.module.rules[i].use.length; j++) {
if (config.module.rules[i].use[j].loader.includes("eslint-loader")) {
config.module.rules[i].use[j].options.useEslintrc = true;
break;
}
}
}
}
return config;
};