forked from bh2smith/safe-airdrop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcraco.config.ts
More file actions
24 lines (20 loc) · 734 Bytes
/
craco.config.ts
File metadata and controls
24 lines (20 loc) · 734 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
import NodePolyfillPlugin from "node-polyfill-webpack-plugin";
import { Configuration } from "webpack/types.d";
const ModuleScopePlugin = require("react-dev-utils/ModuleScopePlugin");
const config = {
babel: {
plugins: ["@emotion/babel-plugin"],
},
webpack: {
plugins: [new NodePolyfillPlugin()],
configure: (webpackConfig: Configuration) => {
if (!webpackConfig?.resolve?.plugins) return webpackConfig;
// Allow imports outside of src/
webpackConfig.resolve.plugins = webpackConfig.resolve.plugins.filter(
({ constructor }: InstanceType<typeof ModuleScopePlugin>) => constructor?.name !== "ModuleScopePlugin",
);
return webpackConfig;
},
},
};
export default config;