-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rescriptsrc.js
37 lines (33 loc) · 900 Bytes
/
.rescriptsrc.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
36
37
const path = require("path");
const resolveFrom = require("resolve-from");
const fixLinkedDependencies = (config) => {
config.resolve = {
...config.resolve,
alias: {
...config.resolve.alias,
react$: resolveFrom(path.resolve("node_modules"), "react"),
"react-dom$": resolveFrom(path.resolve("node_modules"), "react-dom"),
},
};
return config;
};
const includeSrcDirectory = (config) => {
config.resolve = {
...config.resolve,
modules: [path.resolve("src"), ...config.resolve.modules],
};
return config;
};
const allowOutsideSrc = (config) => {
config.resolve.plugins = config.resolve.plugins.filter(
(p) => p.constructor.name !== "ModuleScopePlugin"
);
return config;
};
module.exports = [
["use-babel-config", ".babelrc"],
["use-eslint-config", ".eslintrc"],
fixLinkedDependencies,
allowOutsideSrc,
// includeSrcDirectory,
];