-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcraco.config.js
46 lines (42 loc) · 1.05 KB
/
craco.config.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
45
46
// crago.config.js
// see: https://github.com/sharegate/craco
const path = require('path')
const fs = require('fs')
const cracoBabelLoader = require('craco-babel-loader')
const cracoRawLoaderPlugin = require('@baristalabs/craco-raw-loader')
const appDirectory = fs.realpathSync(process.cwd())
const resolvePackage = relativePath => path.resolve(appDirectory, relativePath)
const includes = [
'catalogue',
'shell',
'sdk',
'connections-table',
'streams-table',
'events-table',
'dht-buckets',
].map(name => resolvePackage(`node_modules/@libp2p/observer-${name}`))
module.exports = {
babel: { plugins: ['babel-plugin-styled-components'] },
plugins: [
{
plugin: {
overrideJestConfig: ({ jestConfig }) => {
jestConfig.transform['^.+\\.(js|jsx|ts|tsx)$'] = ['babel-jest']
return jestConfig
},
},
},
{
plugin: cracoBabelLoader,
options: {
includes,
},
},
{
plugin: cracoRawLoaderPlugin,
options: {
test: /(\.md$|\.base64$)/,
},
},
],
}