-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
35 lines (30 loc) · 915 Bytes
/
config-overrides.js
File metadata and controls
35 lines (30 loc) · 915 Bytes
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
// config-overrides.js
// module.exports = function override(config, env) {
// }
function clientGraphql(config) {
config.module.rules = config.module.rules.map(rule => {
if (rule.oneOf instanceof Array) {
return {
...rule,
// create-react-app let every file which doesn't match to any
// filename test falls back to file-loader,
// so we need to add purs-loader before that fallback.
// see: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/config/webpack.config.dev.js#L220-L236
oneOf: [
{
test: /\.(graphql|gql)$/,
loader: 'graphql-tag/loader',
exclude: /node_modules/
},
...rule.oneOf
]
}
}
return rule
})
return config
}
module.exports = function override(config, env) {
clientGraphql(config)
return config
}