-
Notifications
You must be signed in to change notification settings - Fork 2
/
.rescriptsrc.js
44 lines (42 loc) · 1.13 KB
/
.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
38
39
40
41
42
43
44
const path = require('path');
const transform = ({
module: {
rules: [rule0, { oneOf: matchers }],
...module
},
...config
}) => {
config.optimization.minimizer[0].options.parallel = 2;
return {
...config,
// Edit the Webpack config
module: {
...module,
rules: [
rule0,
// Edit file matchers
{
oneOf: matchers.map(ruleset =>
// Babel Loader rule
String(ruleset.test) === String(/\.(js|mjs|jsx|ts|tsx)$/)
? {
...ruleset,
include: [
ruleset.include,
// This module uses TS 3.8+ `import type` and `export type`
// syntax, and we need Babel remove these imports in order
// to compile the app.
path.resolve(
'node_modules/@mstable/protocol/types/generated',
),
path.resolve('../contracts/types/generated'),
],
}
: ruleset,
),
},
],
},
};
};
module.exports = transform;