We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b809dbe commit ad5d6c1Copy full SHA for ad5d6c1
packages/umi-preset-react-native/src/plugins/generateFiles/react-native/polyfill.ts
@@ -21,6 +21,16 @@ export default (api: IApi) => {
21
return memo;
22
});
23
24
+ api.addEntryCodeAhead(() => {
25
+ if (api.config.define && typeof api.config.define === 'object') {
26
+ const keys = Object.keys(api.config.define);
27
+ return keys
28
+ .map((key) => `global['${key}'] = ${JSON.stringify(api.config.define && api.config.define[key])};`)
29
+ .join('\n');
30
+ }
31
+ return '';
32
+ });
33
+
34
api.addEntryCode(
35
() => `// @ts-ignore
36
let accept: unknown;
0 commit comments