-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcraco.config.js
62 lines (59 loc) · 1.99 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const webpack = require("webpack")
module.exports = {
devServer: {
client: {
webSocketURL: "auto://0.0.0.0/ws",
}
},
jest: {
babel: {
addPresets: true, /* (default value) */
addPlugins: true /* (default value) */
},
configure: (jestConfig, { env, paths, resolve, rootDir }) => { return jestConfig; }
},
webpack: {
configure: {
plugins: [
// Work around for Buffer is undefined:
// https://github.com/webpack/changelog-v5/issues/10
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
resolve: {
fallback: {
assert: require.resolve('assert'),
buffer: require.resolve('buffer'),
crypto: require.resolve('crypto-browserify'),
events: require.resolve('events'),
url: require.resolve('url'),
util: require.resolve('util'),
stream: require.resolve("stream-browserify"),
https: require.resolve("https-browserify"),
os: require.resolve('os-browserify/browser'),
"http": require.resolve("stream-http"),
},
},
}
},
resolve: {
fallback: {
assert: require.resolve('assert'),
buffer: require.resolve('buffer'),
events: require.resolve('events'),
url: require.resolve('url'),
util: require.resolve('util'),
stream: require.resolve("stream-browserify"),
},
},
babel: {
plugins: [
["@babel/plugin-transform-typescript"],
["@babel/plugin-proposal-decorators", { legacy: true }]
]
},
}