-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcraco.config.js
49 lines (48 loc) · 1.34 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
const CracoAlias = require("craco-alias");
const webpack = require("webpack");
module.exports = {
webpack: {
configure: {
resolve: {
fallback: {
util: require.resolve("util"),
stream: require.resolve("stream-browserify"),
crypto: require.resolve("crypto-browserify"),
process: require.resolve("process/browser"),
zlib: require.resolve("browserify-zlib"),
buffer: require.resolve("buffer"),
asset: require.resolve("assert"),
"react/jsx-runtime": "react/jsx-runtime.js",
"react/jsx-dev-runtime": "react/jsx-dev-runtime.js",
},
},
plugins: [
new webpack.DefinePlugin({
process: { env: {} },
}),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
process: "process/browser",
}),
],
},
},
style: {
postOptions: {
plugins: [require("tailwindcss"), require("autoprefixer")],
},
},
plugins: [
{
plugin: CracoAlias,
options: {
source: "tsconfig",
// baseUrl SHOULD be specified
// plugin does not take it from tsconfig
baseUrl: "./src",
// tsConfigPath should point to the file where "baseUrl" and "paths" are specified
tsConfigPath: "./tsconfig.extend.json",
},
},
],
};