@tamagui/vite-plugin 1.13.2 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/extensions.js +1 -39
- package/dist/cjs/extensions.js.map +2 -2
- package/dist/cjs/extract.js +6 -185
- package/dist/cjs/extract.js.map +2 -2
- package/dist/cjs/index.js +1 -21
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/native.js +5 -228
- package/dist/cjs/native.js.map +2 -2
- package/dist/cjs/nativePrebuild.js +1 -133
- package/dist/cjs/nativePrebuild.js.map +2 -2
- package/dist/cjs/plugin.js +1 -125
- package/dist/cjs/plugin.js.map +2 -2
- package/dist/esm/extensions.js +1 -15
- package/dist/esm/extensions.js.map +2 -2
- package/dist/esm/extensions.mjs +1 -15
- package/dist/esm/extensions.mjs.map +2 -2
- package/dist/esm/extract.js +6 -151
- package/dist/esm/extract.js.map +2 -2
- package/dist/esm/extract.mjs +6 -151
- package/dist/esm/extract.mjs.map +2 -2
- package/dist/esm/index.js +1 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -4
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/native.js +5 -203
- package/dist/esm/native.js.map +2 -2
- package/dist/esm/native.mjs +5 -203
- package/dist/esm/native.mjs.map +2 -2
- package/dist/esm/nativePrebuild.js +1 -99
- package/dist/esm/nativePrebuild.js.map +2 -2
- package/dist/esm/nativePrebuild.mjs +1 -99
- package/dist/esm/nativePrebuild.mjs.map +2 -2
- package/dist/esm/plugin.js +1 -101
- package/dist/esm/plugin.js.map +2 -2
- package/dist/esm/plugin.mjs +1 -101
- package/dist/esm/plugin.mjs.map +2 -2
- package/package.json +6 -6
package/dist/esm/native.mjs
CHANGED
|
@@ -1,210 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { join } from "path";
|
|
3
|
-
import { esbuildFlowPlugin } from "@bunchtogether/vite-plugin-flow";
|
|
4
|
-
import { extensions } from "./extensions.js";
|
|
5
|
-
function nativePlugin() {
|
|
6
|
-
return {
|
|
7
|
-
name: "tamagui-native",
|
|
8
|
-
enforce: "post",
|
|
9
|
-
config: (config) => {
|
|
10
|
-
if (!config.build)
|
|
11
|
-
config.build = {};
|
|
12
|
-
config.build.modulePreload = { polyfill: false };
|
|
13
|
-
config.build.assetsInlineLimit = 1e8;
|
|
14
|
-
config.build.chunkSizeWarningLimit = 1e8;
|
|
15
|
-
config.build.cssCodeSplit = false;
|
|
16
|
-
config.build.reportCompressedSize = false;
|
|
17
|
-
config.base = void 0;
|
|
18
|
-
config.resolve ??= {};
|
|
19
|
-
config.resolve.extensions = extensions;
|
|
20
|
-
config.resolve.alias ??= {};
|
|
21
|
-
config.resolve.alias = {
|
|
22
|
-
...config.resolve.alias,
|
|
23
|
-
"react-native/Libraries/Renderer/shims/ReactFabric": "react-native/Libraries/Renderer/shims/ReactFabric",
|
|
24
|
-
"react-native/Libraries/Utilities/codegenNativeComponent": "react-native/Libraries/Utilities/codegenNativeComponent",
|
|
25
|
-
"react-native-svg": "react-native-svg",
|
|
26
|
-
"react-native-web": "react-native",
|
|
27
|
-
"react-native": "react-native"
|
|
28
|
-
};
|
|
29
|
-
config.optimizeDeps ??= {};
|
|
30
|
-
config.optimizeDeps.esbuildOptions ??= {};
|
|
31
|
-
config.optimizeDeps.esbuildOptions.resolveExtensions = extensions;
|
|
32
|
-
config.optimizeDeps.esbuildOptions.plugins ??= [];
|
|
33
|
-
config.optimizeDeps.esbuildOptions.plugins.push(
|
|
34
|
-
esbuildFlowPlugin(
|
|
35
|
-
/node_modules\/(react-native\/|@react-native\/assets)/,
|
|
36
|
-
(_) => "jsx"
|
|
37
|
-
)
|
|
38
|
-
);
|
|
39
|
-
config.optimizeDeps.include ??= [];
|
|
40
|
-
config.optimizeDeps.include.push("react-native");
|
|
41
|
-
config.optimizeDeps.esbuildOptions.loader ??= {};
|
|
42
|
-
config.optimizeDeps.esbuildOptions.loader[".js"] = "jsx";
|
|
43
|
-
config.optimizeDeps.esbuildOptions.plugins.push({
|
|
44
|
-
name: "react-native-assets",
|
|
45
|
-
setup(build) {
|
|
46
|
-
build.onResolve(
|
|
47
|
-
{
|
|
48
|
-
filter: /\.(png|jpg|gif|webp)$/
|
|
49
|
-
},
|
|
50
|
-
async ({ path, namespace }) => {
|
|
51
|
-
return {
|
|
52
|
-
path: "",
|
|
53
|
-
external: true
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
config.build.rollupOptions ??= {};
|
|
60
|
-
config.build.rollupOptions.input = "/Users/n8/tamagui/apps/kitchen-sink/src/index.tsx";
|
|
61
|
-
config.build.rollupOptions.output ??= {};
|
|
62
|
-
config.build.rollupOptions.plugins ??= [];
|
|
63
|
-
config.build.rollupOptions.external = ["react-native", "react", "react/jsx-runtime"];
|
|
64
|
-
if (!Array.isArray(config.build.rollupOptions.plugins)) {
|
|
65
|
-
throw `x`;
|
|
66
|
-
}
|
|
67
|
-
if (process.env.DEBUG) {
|
|
68
|
-
console.log("config..", config);
|
|
69
|
-
}
|
|
70
|
-
config.build.commonjsOptions = {
|
|
71
|
-
include: /node_modules\/react\//
|
|
72
|
-
};
|
|
73
|
-
config.build.rollupOptions.plugins.push({
|
|
74
|
-
name: `swap-react-native`,
|
|
75
|
-
async load(id) {
|
|
76
|
-
if (id.endsWith("react-native/index.js")) {
|
|
77
|
-
const bundled = await readFile(
|
|
78
|
-
join(process.cwd(), "react-native.js"),
|
|
79
|
-
"utf-8"
|
|
80
|
-
);
|
|
81
|
-
const code = bundled;
|
|
82
|
-
return {
|
|
83
|
-
code: `
|
|
1
|
+
import{readFile as n}from"fs/promises";import{join as l}from"path";import{esbuildFlowPlugin as p}from"@bunchtogether/vite-plugin-flow";import{extensions as r}from"./extensions.js";function h(){return{name:"tamagui-native",enforce:"post",config:e=>{if(e.build||(e.build={}),e.build.modulePreload={polyfill:!1},e.build.assetsInlineLimit=1e8,e.build.chunkSizeWarningLimit=1e8,e.build.cssCodeSplit=!1,e.build.reportCompressedSize=!1,e.base=void 0,e.resolve??={},e.resolve.extensions=r,e.resolve.alias??={},e.resolve.alias={...e.resolve.alias,"react-native/Libraries/Renderer/shims/ReactFabric":"react-native/Libraries/Renderer/shims/ReactFabric","react-native/Libraries/Utilities/codegenNativeComponent":"react-native/Libraries/Utilities/codegenNativeComponent","react-native-svg":"react-native-svg","react-native-web":"react-native","react-native":"react-native"},e.optimizeDeps??={},e.optimizeDeps.esbuildOptions??={},e.optimizeDeps.esbuildOptions.resolveExtensions=r,e.optimizeDeps.esbuildOptions.plugins??=[],e.optimizeDeps.esbuildOptions.plugins.push(p(/node_modules\/(react-native\/|@react-native\/assets)/,t=>"jsx")),e.optimizeDeps.include??=[],e.optimizeDeps.include.push("react-native"),e.optimizeDeps.esbuildOptions.loader??={},e.optimizeDeps.esbuildOptions.loader[".js"]="jsx",e.optimizeDeps.esbuildOptions.plugins.push({name:"react-native-assets",setup(t){t.onResolve({filter:/\.(png|jpg|gif|webp)$/},async({path:i,namespace:o})=>({path:"",external:!0}))}}),e.build.rollupOptions??={},e.build.rollupOptions.input="/Users/n8/tamagui/apps/kitchen-sink/src/index.tsx",e.build.rollupOptions.output??={},e.build.rollupOptions.plugins??=[],e.build.rollupOptions.external=["react-native","react","react/jsx-runtime"],!Array.isArray(e.build.rollupOptions.plugins))throw"x";process.env.DEBUG&&console.log("config..",e),e.build.commonjsOptions={include:/node_modules\/react\//},e.build.rollupOptions.plugins.push({name:"swap-react-native",async load(t){if(t.endsWith("react-native/index.js")){const i=await n(l(process.cwd(),"react-native.js"),"utf-8"),o=i;return{code:`
|
|
84
2
|
const run = () => {
|
|
85
|
-
${
|
|
86
|
-
`module.exports = require_react_native();`,
|
|
87
|
-
`return require_react_native();`
|
|
88
|
-
)}
|
|
3
|
+
${i.replace("module.exports = require_react_native();","return require_react_native();")}
|
|
89
4
|
}
|
|
90
5
|
|
|
91
6
|
const RN = run()
|
|
92
7
|
|
|
93
|
-
${
|
|
94
|
-
|
|
95
|
-
// adding exports
|
|
96
|
-
`export const ${name} = RN.${name}`
|
|
97
|
-
)
|
|
98
|
-
).join("\n")}
|
|
8
|
+
${u.map(a=>`export const ${a} = RN.${a}`).join(`
|
|
9
|
+
`)}
|
|
99
10
|
|
|
100
|
-
`
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
const updateOutputOptions = (out) => {
|
|
106
|
-
out.inlineDynamicImports = true;
|
|
107
|
-
out.manualChunks = void 0;
|
|
108
|
-
};
|
|
109
|
-
if (Array.isArray(config.build.rollupOptions.output)) {
|
|
110
|
-
for (const o in config.build.rollupOptions.output)
|
|
111
|
-
updateOutputOptions(o);
|
|
112
|
-
} else {
|
|
113
|
-
updateOutputOptions(config.build.rollupOptions.output);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
const RNExportNames = [
|
|
119
|
-
"AccessibilityInfo",
|
|
120
|
-
"ActivityIndicator",
|
|
121
|
-
"Button",
|
|
122
|
-
"DatePickerIOS",
|
|
123
|
-
"DrawerLayoutAndroid",
|
|
124
|
-
"FlatList",
|
|
125
|
-
"Image",
|
|
126
|
-
"ImageBackground",
|
|
127
|
-
"InputAccessoryView",
|
|
128
|
-
"KeyboardAvoidingView",
|
|
129
|
-
"MaskedViewIOS",
|
|
130
|
-
"Modal",
|
|
131
|
-
"Pressable",
|
|
132
|
-
"ProgressBarAndroid",
|
|
133
|
-
"ProgressViewIOS",
|
|
134
|
-
"RefreshControl",
|
|
135
|
-
"SafeAreaView",
|
|
136
|
-
"ScrollView",
|
|
137
|
-
"SectionList",
|
|
138
|
-
"Slider",
|
|
139
|
-
"StatusBar",
|
|
140
|
-
"Switch",
|
|
141
|
-
"Text",
|
|
142
|
-
"TextInput",
|
|
143
|
-
"Touchable",
|
|
144
|
-
"TouchableHighlight",
|
|
145
|
-
"TouchableNativeFeedback",
|
|
146
|
-
"TouchableOpacity",
|
|
147
|
-
"TouchableWithoutFeedback",
|
|
148
|
-
"View",
|
|
149
|
-
"VirtualizedList",
|
|
150
|
-
"VirtualizedSectionList",
|
|
151
|
-
"ActionSheetIOS",
|
|
152
|
-
"Alert",
|
|
153
|
-
"Animated",
|
|
154
|
-
"Appearance",
|
|
155
|
-
"AppRegistry",
|
|
156
|
-
"AppState",
|
|
157
|
-
"AsyncStorage",
|
|
158
|
-
"BackHandler",
|
|
159
|
-
"Clipboard",
|
|
160
|
-
"DeviceInfo",
|
|
161
|
-
"DevSettings",
|
|
162
|
-
"Dimensions",
|
|
163
|
-
"Easing",
|
|
164
|
-
"findNodeHandle",
|
|
165
|
-
"I18nManager",
|
|
166
|
-
"ImagePickerIOS",
|
|
167
|
-
"InteractionManager",
|
|
168
|
-
"Keyboard",
|
|
169
|
-
"LayoutAnimation",
|
|
170
|
-
"Linking",
|
|
171
|
-
"LogBox",
|
|
172
|
-
"NativeDialogManagerAndroid",
|
|
173
|
-
"NativeEventEmitter",
|
|
174
|
-
"Networking",
|
|
175
|
-
"PanResponder",
|
|
176
|
-
"PermissionsAndroid",
|
|
177
|
-
"PixelRatio",
|
|
178
|
-
// 'PushNotificationIOS',
|
|
179
|
-
"Settings",
|
|
180
|
-
"Share",
|
|
181
|
-
"StyleSheet",
|
|
182
|
-
"Systrace",
|
|
183
|
-
"ToastAndroid",
|
|
184
|
-
"TurboModuleRegistry",
|
|
185
|
-
"UIManager",
|
|
186
|
-
"unstable_batchedUpdates",
|
|
187
|
-
"useColorScheme",
|
|
188
|
-
"useWindowDimensions",
|
|
189
|
-
"UTFSequence",
|
|
190
|
-
"Vibration",
|
|
191
|
-
"YellowBox",
|
|
192
|
-
"DeviceEventEmitter",
|
|
193
|
-
"DynamicColorIOS",
|
|
194
|
-
"NativeAppEventEmitter",
|
|
195
|
-
"NativeModules",
|
|
196
|
-
"Platform",
|
|
197
|
-
"PlatformColor",
|
|
198
|
-
"processColor",
|
|
199
|
-
"requireNativeComponent",
|
|
200
|
-
"RootTagContext"
|
|
201
|
-
// 'unstable_enableLogBox',
|
|
202
|
-
// 'ColorPropType',
|
|
203
|
-
// 'EdgeInsetsPropType',
|
|
204
|
-
// 'PointPropType',
|
|
205
|
-
// 'ViewPropTypes',
|
|
206
|
-
];
|
|
207
|
-
export {
|
|
208
|
-
nativePlugin
|
|
209
|
-
};
|
|
11
|
+
`}}}});const s=t=>{t.inlineDynamicImports=!0,t.manualChunks=void 0};if(Array.isArray(e.build.rollupOptions.output))for(const t in e.build.rollupOptions.output)s(t);else s(e.build.rollupOptions.output)}}}const u=["AccessibilityInfo","ActivityIndicator","Button","DatePickerIOS","DrawerLayoutAndroid","FlatList","Image","ImageBackground","InputAccessoryView","KeyboardAvoidingView","MaskedViewIOS","Modal","Pressable","ProgressBarAndroid","ProgressViewIOS","RefreshControl","SafeAreaView","ScrollView","SectionList","Slider","StatusBar","Switch","Text","TextInput","Touchable","TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","View","VirtualizedList","VirtualizedSectionList","ActionSheetIOS","Alert","Animated","Appearance","AppRegistry","AppState","AsyncStorage","BackHandler","Clipboard","DeviceInfo","DevSettings","Dimensions","Easing","findNodeHandle","I18nManager","ImagePickerIOS","InteractionManager","Keyboard","LayoutAnimation","Linking","LogBox","NativeDialogManagerAndroid","NativeEventEmitter","Networking","PanResponder","PermissionsAndroid","PixelRatio","Settings","Share","StyleSheet","Systrace","ToastAndroid","TurboModuleRegistry","UIManager","unstable_batchedUpdates","useColorScheme","useWindowDimensions","UTFSequence","Vibration","YellowBox","DeviceEventEmitter","DynamicColorIOS","NativeAppEventEmitter","NativeModules","Platform","PlatformColor","processColor","requireNativeComponent","RootTagContext"];export{h as nativePlugin};
|
|
210
12
|
//# sourceMappingURL=native.mjs.map
|
package/dist/esm/native.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/native.ts"],
|
|
4
4
|
"sourcesContent": ["import { readFile } from 'fs/promises'\nimport { join } from 'path'\n\nimport { esbuildFlowPlugin } from '@bunchtogether/vite-plugin-flow'\nimport { OutputOptions } from 'rollup'\nimport type { Plugin } from 'vite'\n\nimport { extensions } from './extensions.js'\n\nexport function nativePlugin(): Plugin {\n return {\n name: 'tamagui-native',\n enforce: 'post',\n\n config: (config) => {\n if (!config.build) config.build = {}\n\n config.build.modulePreload = { polyfill: false }\n // Ensures that even very large assets are inlined in your JavaScript.\n config.build.assetsInlineLimit = 100000000\n // Avoid warnings about large chunks.\n config.build.chunkSizeWarningLimit = 100000000\n // Emit all CSS as a single file, which `vite-plugin-singlefile` can then inline.\n config.build.cssCodeSplit = false\n // Avoids the extra step of testing Brotli compression, which isn't really pertinent to a file served locally.\n config.build.reportCompressedSize = false\n // Subfolder bases are not supported, and shouldn't be needed because we're embedding everything.\n config.base = undefined\n\n config.resolve ??= {}\n\n config.resolve.extensions = extensions\n\n config.resolve.alias ??= {}\n config.resolve.alias = {\n ...config.resolve.alias,\n 'react-native/Libraries/Renderer/shims/ReactFabric':\n 'react-native/Libraries/Renderer/shims/ReactFabric',\n 'react-native/Libraries/Utilities/codegenNativeComponent':\n 'react-native/Libraries/Utilities/codegenNativeComponent',\n 'react-native-svg': 'react-native-svg',\n 'react-native-web': 'react-native',\n 'react-native': 'react-native',\n }\n\n config.optimizeDeps ??= {}\n config.optimizeDeps.esbuildOptions ??= {}\n config.optimizeDeps.esbuildOptions.resolveExtensions = extensions\n\n config.optimizeDeps.esbuildOptions.plugins ??= []\n config.optimizeDeps.esbuildOptions.plugins.push(\n esbuildFlowPlugin(\n /node_modules\\/(react-native\\/|@react-native\\/assets)/,\n (_) => 'jsx'\n )\n )\n // config.optimizeDeps.esbuildOptions.plugins.push(esbuildCommonjs(['react-native']))\n\n config.optimizeDeps.include ??= []\n config.optimizeDeps.include.push('react-native')\n\n config.optimizeDeps.esbuildOptions.loader ??= {}\n config.optimizeDeps.esbuildOptions.loader['.js'] = 'jsx'\n\n config.optimizeDeps.esbuildOptions.plugins.push({\n name: 'react-native-assets',\n setup(build) {\n build.onResolve(\n {\n filter: /\\.(png|jpg|gif|webp)$/,\n },\n async ({ path, namespace }) => {\n return {\n path: '',\n external: true,\n }\n }\n )\n },\n })\n\n config.build.rollupOptions ??= {}\n\n config.build.rollupOptions.input =\n '/Users/n8/tamagui/apps/kitchen-sink/src/index.tsx'\n\n config.build.rollupOptions.output ??= {}\n\n config.build.rollupOptions.plugins ??= []\n\n config.build.rollupOptions.external = ['react-native', 'react', 'react/jsx-runtime']\n\n if (!Array.isArray(config.build.rollupOptions.plugins)) {\n throw `x`\n }\n\n if (process.env.DEBUG) {\n console.log('config..', config)\n }\n\n config.build.commonjsOptions = {\n include: /node_modules\\/react\\//,\n }\n\n config.build.rollupOptions.plugins.push({\n name: `swap-react-native`,\n async load(id) {\n if (id.endsWith('react-native/index.js')) {\n const bundled = await readFile(\n join(process.cwd(), 'react-native.js'),\n 'utf-8'\n )\n const code = bundled\n return {\n code: `\nconst run = () => { \n ${bundled.replace(\n `module.exports = require_react_native();`,\n `return require_react_native();`\n )}\n}\n\nconst RN = run()\n\n${RNExportNames.map(\n (name) =>\n // adding exports\n `export const ${name} = RN.${name}`\n).join('\\n')}\n\n`,\n }\n }\n },\n })\n\n const updateOutputOptions = (out: OutputOptions) => {\n // Ensure that as many resources as possible are inlined.\n out.inlineDynamicImports = true\n\n // added by me (nate):\n out.manualChunks = undefined\n }\n\n if (Array.isArray(config.build.rollupOptions.output)) {\n for (const o in config.build.rollupOptions.output)\n updateOutputOptions(o as OutputOptions)\n } else {\n updateOutputOptions(config.build.rollupOptions.output as OutputOptions)\n }\n },\n }\n}\n\nconst RNExportNames = [\n 'AccessibilityInfo',\n 'ActivityIndicator',\n 'Button',\n 'DatePickerIOS',\n 'DrawerLayoutAndroid',\n 'FlatList',\n 'Image',\n 'ImageBackground',\n 'InputAccessoryView',\n 'KeyboardAvoidingView',\n 'MaskedViewIOS',\n 'Modal',\n 'Pressable',\n 'ProgressBarAndroid',\n 'ProgressViewIOS',\n 'RefreshControl',\n 'SafeAreaView',\n 'ScrollView',\n 'SectionList',\n 'Slider',\n 'StatusBar',\n 'Switch',\n 'Text',\n 'TextInput',\n 'Touchable',\n 'TouchableHighlight',\n 'TouchableNativeFeedback',\n 'TouchableOpacity',\n 'TouchableWithoutFeedback',\n 'View',\n 'VirtualizedList',\n 'VirtualizedSectionList',\n 'ActionSheetIOS',\n 'Alert',\n 'Animated',\n 'Appearance',\n 'AppRegistry',\n 'AppState',\n 'AsyncStorage',\n 'BackHandler',\n 'Clipboard',\n 'DeviceInfo',\n 'DevSettings',\n 'Dimensions',\n 'Easing',\n 'findNodeHandle',\n 'I18nManager',\n 'ImagePickerIOS',\n 'InteractionManager',\n 'Keyboard',\n 'LayoutAnimation',\n 'Linking',\n 'LogBox',\n 'NativeDialogManagerAndroid',\n 'NativeEventEmitter',\n 'Networking',\n 'PanResponder',\n 'PermissionsAndroid',\n 'PixelRatio',\n // 'PushNotificationIOS',\n 'Settings',\n 'Share',\n 'StyleSheet',\n 'Systrace',\n 'ToastAndroid',\n 'TurboModuleRegistry',\n 'UIManager',\n 'unstable_batchedUpdates',\n 'useColorScheme',\n 'useWindowDimensions',\n 'UTFSequence',\n 'Vibration',\n 'YellowBox',\n 'DeviceEventEmitter',\n 'DynamicColorIOS',\n 'NativeAppEventEmitter',\n 'NativeModules',\n 'Platform',\n 'PlatformColor',\n 'processColor',\n 'requireNativeComponent',\n 'RootTagContext',\n // 'unstable_enableLogBox',\n // 'ColorPropType',\n // 'EdgeInsetsPropType',\n // 'PointPropType',\n // 'ViewPropTypes',\n]\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAS,YAAAA,MAAgB,cACzB,OAAS,QAAAC,MAAY,OAErB,OAAS,qBAAAC,MAAyB,kCAIlC,OAAS,cAAAC,MAAkB,kB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A,sBACA,YACA,0BACA,iBACA,sBACA,cACA,YACA,YACA,qBACA,kBACA,wBACA,gBACA,WACA,gBACA,eACA,yBACA,gBAMF",
|
|
6
|
+
"names": ["readFile", "join", "esbuildFlowPlugin", "extensions", "nativePlugin", "config", "_", "build", "path", "namespace", "id", "bundled", "code", "RNExportNames", "name", "updateOutputOptions", "out", "o"]
|
|
7
7
|
}
|
|
@@ -1,100 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { build } from "esbuild";
|
|
3
|
-
import flowRemoveTypes from "flow-remove-types";
|
|
4
|
-
import { extensions } from "./extensions.js";
|
|
5
|
-
async function nativePrebuild() {
|
|
6
|
-
console.log(`Prebuilding React Native (one time cost...)`);
|
|
7
|
-
await Promise.all([
|
|
8
|
-
// react
|
|
9
|
-
build({
|
|
10
|
-
bundle: true,
|
|
11
|
-
entryPoints: ["react"],
|
|
12
|
-
outfile: "react.js",
|
|
13
|
-
format: "cjs",
|
|
14
|
-
target: "node14",
|
|
15
|
-
jsx: "transform",
|
|
16
|
-
jsxFactory: "react",
|
|
17
|
-
allowOverwrite: true,
|
|
18
|
-
platform: "node",
|
|
19
|
-
define: {
|
|
20
|
-
__DEV__: "true",
|
|
21
|
-
"process.env.NODE_ENV": `"development"`
|
|
22
|
-
},
|
|
23
|
-
logLevel: "warning",
|
|
24
|
-
resolveExtensions: extensions
|
|
25
|
-
}),
|
|
26
|
-
// react-jsx-runtime
|
|
27
|
-
build({
|
|
28
|
-
bundle: true,
|
|
29
|
-
entryPoints: ["react/jsx-runtime"],
|
|
30
|
-
outfile: "react-jsx-runtime.js",
|
|
31
|
-
format: "cjs",
|
|
32
|
-
target: "node14",
|
|
33
|
-
jsx: "transform",
|
|
34
|
-
jsxFactory: "react",
|
|
35
|
-
external: ["react"],
|
|
36
|
-
allowOverwrite: true,
|
|
37
|
-
platform: "node",
|
|
38
|
-
define: {
|
|
39
|
-
// metro serves this in production mode
|
|
40
|
-
__DEV__: "false",
|
|
41
|
-
"process.env.NODE_ENV": `"production"`
|
|
42
|
-
},
|
|
43
|
-
logLevel: "warning",
|
|
44
|
-
resolveExtensions: extensions
|
|
45
|
-
}),
|
|
46
|
-
// react native
|
|
47
|
-
build({
|
|
48
|
-
bundle: true,
|
|
49
|
-
entryPoints: ["/Users/n8/tamagui/node_modules/react-native/index.js"],
|
|
50
|
-
outfile: "react-native.js",
|
|
51
|
-
format: "cjs",
|
|
52
|
-
target: "node14",
|
|
53
|
-
jsx: "transform",
|
|
54
|
-
jsxFactory: "react",
|
|
55
|
-
allowOverwrite: true,
|
|
56
|
-
platform: "node",
|
|
57
|
-
loader: {
|
|
58
|
-
".png": "dataurl",
|
|
59
|
-
".jpg": "dataurl",
|
|
60
|
-
".jpeg": "dataurl",
|
|
61
|
-
".gif": "dataurl"
|
|
62
|
-
},
|
|
63
|
-
define: {
|
|
64
|
-
__DEV__: "true",
|
|
65
|
-
"process.env.NODE_ENV": `"development"`
|
|
66
|
-
},
|
|
67
|
-
logLevel: "warning",
|
|
68
|
-
resolveExtensions: extensions,
|
|
69
|
-
external: ["react", "react/jsx-runtime.js", "react/jsx-runtime"],
|
|
70
|
-
plugins: [
|
|
71
|
-
{
|
|
72
|
-
name: "remove-flow",
|
|
73
|
-
setup(build2) {
|
|
74
|
-
build2.onLoad(
|
|
75
|
-
{
|
|
76
|
-
filter: /.*.js/
|
|
77
|
-
},
|
|
78
|
-
async (input) => {
|
|
79
|
-
if (!input.path.includes("react-native")) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const code = await readFile(input.path, "utf-8");
|
|
83
|
-
const output = flowRemoveTypes(code, { pretty: true });
|
|
84
|
-
const contents = output.toString().replace(/static\s+\+/g, "static ");
|
|
85
|
-
return {
|
|
86
|
-
contents,
|
|
87
|
-
loader: "jsx"
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
})
|
|
95
|
-
]);
|
|
96
|
-
}
|
|
97
|
-
export {
|
|
98
|
-
nativePrebuild
|
|
99
|
-
};
|
|
1
|
+
import{readFile as a}from"fs/promises";import{build as e}from"esbuild";import s from"flow-remove-types";import{extensions as t}from"./extensions.js";async function f(){console.log("Prebuilding React Native (one time cost...)"),await Promise.all([e({bundle:!0,entryPoints:["react"],outfile:"react.js",format:"cjs",target:"node14",jsx:"transform",jsxFactory:"react",allowOverwrite:!0,platform:"node",define:{__DEV__:"true","process.env.NODE_ENV":'"development"'},logLevel:"warning",resolveExtensions:t}),e({bundle:!0,entryPoints:["react/jsx-runtime"],outfile:"react-jsx-runtime.js",format:"cjs",target:"node14",jsx:"transform",jsxFactory:"react",external:["react"],allowOverwrite:!0,platform:"node",define:{__DEV__:"false","process.env.NODE_ENV":'"production"'},logLevel:"warning",resolveExtensions:t}),e({bundle:!0,entryPoints:["/Users/n8/tamagui/node_modules/react-native/index.js"],outfile:"react-native.js",format:"cjs",target:"node14",jsx:"transform",jsxFactory:"react",allowOverwrite:!0,platform:"node",loader:{".png":"dataurl",".jpg":"dataurl",".jpeg":"dataurl",".gif":"dataurl"},define:{__DEV__:"true","process.env.NODE_ENV":'"development"'},logLevel:"warning",resolveExtensions:t,external:["react","react/jsx-runtime.js","react/jsx-runtime"],plugins:[{name:"remove-flow",setup(o){o.onLoad({filter:/.*.js/},async r=>{if(!r.path.includes("react-native"))return;const n=await a(r.path,"utf-8");return{contents:s(n,{pretty:!0}).toString().replace(/static\s+\+/g,"static "),loader:"jsx"}})}}]})])}export{f as nativePrebuild};
|
|
100
2
|
//# sourceMappingURL=nativePrebuild.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/nativePrebuild.ts"],
|
|
4
4
|
"sourcesContent": ["import { readFile } from 'fs/promises'\n\nimport { build } from 'esbuild'\nimport flowRemoveTypes from 'flow-remove-types'\n\nimport { extensions } from './extensions.js'\n\nexport async function nativePrebuild() {\n console.log(`Prebuilding React Native (one time cost...)`)\n await Promise.all([\n // react\n build({\n bundle: true,\n entryPoints: ['react'],\n outfile: 'react.js',\n format: 'cjs',\n target: 'node14',\n jsx: 'transform',\n jsxFactory: 'react',\n allowOverwrite: true,\n platform: 'node',\n define: {\n __DEV__: 'true',\n 'process.env.NODE_ENV': `\"development\"`,\n },\n logLevel: 'warning',\n resolveExtensions: extensions,\n }),\n // react-jsx-runtime\n build({\n bundle: true,\n entryPoints: ['react/jsx-runtime'],\n outfile: 'react-jsx-runtime.js',\n format: 'cjs',\n target: 'node14',\n jsx: 'transform',\n jsxFactory: 'react',\n external: ['react'],\n allowOverwrite: true,\n platform: 'node',\n define: {\n // metro serves this in production mode\n __DEV__: 'false',\n 'process.env.NODE_ENV': `\"production\"`,\n },\n logLevel: 'warning',\n resolveExtensions: extensions,\n }),\n // react native\n build({\n bundle: true,\n entryPoints: ['/Users/n8/tamagui/node_modules/react-native/index.js'],\n outfile: 'react-native.js',\n format: 'cjs',\n target: 'node14',\n jsx: 'transform',\n jsxFactory: 'react',\n allowOverwrite: true,\n platform: 'node',\n loader: {\n '.png': 'dataurl',\n '.jpg': 'dataurl',\n '.jpeg': 'dataurl',\n '.gif': 'dataurl',\n },\n define: {\n __DEV__: 'true',\n 'process.env.NODE_ENV': `\"development\"`,\n },\n logLevel: 'warning',\n resolveExtensions: extensions,\n external: ['react', 'react/jsx-runtime.js', 'react/jsx-runtime'],\n plugins: [\n {\n name: 'remove-flow',\n setup(build) {\n build.onLoad(\n {\n filter: /.*.js/,\n },\n async (input) => {\n if (!input.path.includes('react-native')) {\n return\n }\n const code = await readFile(input.path, 'utf-8')\n const output = flowRemoveTypes(code, { pretty: true })\n const contents = output.toString().replace(/static\\s+\\+/g, 'static ')\n return {\n contents,\n loader: 'jsx',\n }\n }\n )\n },\n },\n ],\n }),\n ])\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": ["build"]
|
|
5
|
+
"mappings": "AAAA,OAAS,YAAAA,MAAg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AQ,KACV,CACF,CACF,CACF,CACF,CACF,CACF,CAAC,CACH,CAAC,CACH",
|
|
6
|
+
"names": ["readFile", "build", "flowRemoveTypes", "extensions", "nativePrebuild", "input", "code"]
|
|
7
7
|
}
|
|
@@ -1,100 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { build } from "esbuild";
|
|
3
|
-
import flowRemoveTypes from "flow-remove-types";
|
|
4
|
-
import { extensions } from "./extensions.js";
|
|
5
|
-
async function nativePrebuild() {
|
|
6
|
-
console.log(`Prebuilding React Native (one time cost...)`);
|
|
7
|
-
await Promise.all([
|
|
8
|
-
// react
|
|
9
|
-
build({
|
|
10
|
-
bundle: true,
|
|
11
|
-
entryPoints: ["react"],
|
|
12
|
-
outfile: "react.js",
|
|
13
|
-
format: "cjs",
|
|
14
|
-
target: "node14",
|
|
15
|
-
jsx: "transform",
|
|
16
|
-
jsxFactory: "react",
|
|
17
|
-
allowOverwrite: true,
|
|
18
|
-
platform: "node",
|
|
19
|
-
define: {
|
|
20
|
-
__DEV__: "true",
|
|
21
|
-
"process.env.NODE_ENV": `"development"`
|
|
22
|
-
},
|
|
23
|
-
logLevel: "warning",
|
|
24
|
-
resolveExtensions: extensions
|
|
25
|
-
}),
|
|
26
|
-
// react-jsx-runtime
|
|
27
|
-
build({
|
|
28
|
-
bundle: true,
|
|
29
|
-
entryPoints: ["react/jsx-runtime"],
|
|
30
|
-
outfile: "react-jsx-runtime.js",
|
|
31
|
-
format: "cjs",
|
|
32
|
-
target: "node14",
|
|
33
|
-
jsx: "transform",
|
|
34
|
-
jsxFactory: "react",
|
|
35
|
-
external: ["react"],
|
|
36
|
-
allowOverwrite: true,
|
|
37
|
-
platform: "node",
|
|
38
|
-
define: {
|
|
39
|
-
// metro serves this in production mode
|
|
40
|
-
__DEV__: "false",
|
|
41
|
-
"process.env.NODE_ENV": `"production"`
|
|
42
|
-
},
|
|
43
|
-
logLevel: "warning",
|
|
44
|
-
resolveExtensions: extensions
|
|
45
|
-
}),
|
|
46
|
-
// react native
|
|
47
|
-
build({
|
|
48
|
-
bundle: true,
|
|
49
|
-
entryPoints: ["/Users/n8/tamagui/node_modules/react-native/index.js"],
|
|
50
|
-
outfile: "react-native.js",
|
|
51
|
-
format: "cjs",
|
|
52
|
-
target: "node14",
|
|
53
|
-
jsx: "transform",
|
|
54
|
-
jsxFactory: "react",
|
|
55
|
-
allowOverwrite: true,
|
|
56
|
-
platform: "node",
|
|
57
|
-
loader: {
|
|
58
|
-
".png": "dataurl",
|
|
59
|
-
".jpg": "dataurl",
|
|
60
|
-
".jpeg": "dataurl",
|
|
61
|
-
".gif": "dataurl"
|
|
62
|
-
},
|
|
63
|
-
define: {
|
|
64
|
-
__DEV__: "true",
|
|
65
|
-
"process.env.NODE_ENV": `"development"`
|
|
66
|
-
},
|
|
67
|
-
logLevel: "warning",
|
|
68
|
-
resolveExtensions: extensions,
|
|
69
|
-
external: ["react", "react/jsx-runtime.js", "react/jsx-runtime"],
|
|
70
|
-
plugins: [
|
|
71
|
-
{
|
|
72
|
-
name: "remove-flow",
|
|
73
|
-
setup(build2) {
|
|
74
|
-
build2.onLoad(
|
|
75
|
-
{
|
|
76
|
-
filter: /.*.js/
|
|
77
|
-
},
|
|
78
|
-
async (input) => {
|
|
79
|
-
if (!input.path.includes("react-native")) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const code = await readFile(input.path, "utf-8");
|
|
83
|
-
const output = flowRemoveTypes(code, { pretty: true });
|
|
84
|
-
const contents = output.toString().replace(/static\s+\+/g, "static ");
|
|
85
|
-
return {
|
|
86
|
-
contents,
|
|
87
|
-
loader: "jsx"
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
})
|
|
95
|
-
]);
|
|
96
|
-
}
|
|
97
|
-
export {
|
|
98
|
-
nativePrebuild
|
|
99
|
-
};
|
|
1
|
+
import{readFile as a}from"fs/promises";import{build as e}from"esbuild";import s from"flow-remove-types";import{extensions as t}from"./extensions.js";async function f(){console.log("Prebuilding React Native (one time cost...)"),await Promise.all([e({bundle:!0,entryPoints:["react"],outfile:"react.js",format:"cjs",target:"node14",jsx:"transform",jsxFactory:"react",allowOverwrite:!0,platform:"node",define:{__DEV__:"true","process.env.NODE_ENV":'"development"'},logLevel:"warning",resolveExtensions:t}),e({bundle:!0,entryPoints:["react/jsx-runtime"],outfile:"react-jsx-runtime.js",format:"cjs",target:"node14",jsx:"transform",jsxFactory:"react",external:["react"],allowOverwrite:!0,platform:"node",define:{__DEV__:"false","process.env.NODE_ENV":'"production"'},logLevel:"warning",resolveExtensions:t}),e({bundle:!0,entryPoints:["/Users/n8/tamagui/node_modules/react-native/index.js"],outfile:"react-native.js",format:"cjs",target:"node14",jsx:"transform",jsxFactory:"react",allowOverwrite:!0,platform:"node",loader:{".png":"dataurl",".jpg":"dataurl",".jpeg":"dataurl",".gif":"dataurl"},define:{__DEV__:"true","process.env.NODE_ENV":'"development"'},logLevel:"warning",resolveExtensions:t,external:["react","react/jsx-runtime.js","react/jsx-runtime"],plugins:[{name:"remove-flow",setup(o){o.onLoad({filter:/.*.js/},async r=>{if(!r.path.includes("react-native"))return;const n=await a(r.path,"utf-8");return{contents:s(n,{pretty:!0}).toString().replace(/static\s+\+/g,"static "),loader:"jsx"}})}}]})])}export{f as nativePrebuild};
|
|
100
2
|
//# sourceMappingURL=nativePrebuild.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/nativePrebuild.ts"],
|
|
4
4
|
"sourcesContent": ["import { readFile } from 'fs/promises'\n\nimport { build } from 'esbuild'\nimport flowRemoveTypes from 'flow-remove-types'\n\nimport { extensions } from './extensions.js'\n\nexport async function nativePrebuild() {\n console.log(`Prebuilding React Native (one time cost...)`)\n await Promise.all([\n // react\n build({\n bundle: true,\n entryPoints: ['react'],\n outfile: 'react.js',\n format: 'cjs',\n target: 'node14',\n jsx: 'transform',\n jsxFactory: 'react',\n allowOverwrite: true,\n platform: 'node',\n define: {\n __DEV__: 'true',\n 'process.env.NODE_ENV': `\"development\"`,\n },\n logLevel: 'warning',\n resolveExtensions: extensions,\n }),\n // react-jsx-runtime\n build({\n bundle: true,\n entryPoints: ['react/jsx-runtime'],\n outfile: 'react-jsx-runtime.js',\n format: 'cjs',\n target: 'node14',\n jsx: 'transform',\n jsxFactory: 'react',\n external: ['react'],\n allowOverwrite: true,\n platform: 'node',\n define: {\n // metro serves this in production mode\n __DEV__: 'false',\n 'process.env.NODE_ENV': `\"production\"`,\n },\n logLevel: 'warning',\n resolveExtensions: extensions,\n }),\n // react native\n build({\n bundle: true,\n entryPoints: ['/Users/n8/tamagui/node_modules/react-native/index.js'],\n outfile: 'react-native.js',\n format: 'cjs',\n target: 'node14',\n jsx: 'transform',\n jsxFactory: 'react',\n allowOverwrite: true,\n platform: 'node',\n loader: {\n '.png': 'dataurl',\n '.jpg': 'dataurl',\n '.jpeg': 'dataurl',\n '.gif': 'dataurl',\n },\n define: {\n __DEV__: 'true',\n 'process.env.NODE_ENV': `\"development\"`,\n },\n logLevel: 'warning',\n resolveExtensions: extensions,\n external: ['react', 'react/jsx-runtime.js', 'react/jsx-runtime'],\n plugins: [\n {\n name: 'remove-flow',\n setup(build) {\n build.onLoad(\n {\n filter: /.*.js/,\n },\n async (input) => {\n if (!input.path.includes('react-native')) {\n return\n }\n const code = await readFile(input.path, 'utf-8')\n const output = flowRemoveTypes(code, { pretty: true })\n const contents = output.toString().replace(/static\\s+\\+/g, 'static ')\n return {\n contents,\n loader: 'jsx',\n }\n }\n )\n },\n },\n ],\n }),\n ])\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": ["build"]
|
|
5
|
+
"mappings": "AAAA,OAAS,YAAAA,MAAgB,cAEzB,OAAS,SAAAC,MAAa,UACtB,OAAOC,MAAqB,oBAE5B,OAAS,cAAAC,MAAkB,kBAE3B,eAAsBC,G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Types", "extensions", "nativePrebuild", "input", "code"]
|
|
7
7
|
}
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1,102 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
const components = [.../* @__PURE__ */ new Set([...options.components, "tamagui", "@tamagui/core"])];
|
|
3
|
-
const noExternalSSR = new RegExp(
|
|
4
|
-
`${components.join("|")}|react-native|expo-linear-gradient`,
|
|
5
|
-
"ig"
|
|
6
|
-
);
|
|
7
|
-
const plugin = {
|
|
8
|
-
name: "tamagui-base",
|
|
9
|
-
enforce: "pre",
|
|
10
|
-
config(userConfig, env) {
|
|
11
|
-
return {
|
|
12
|
-
plugins: [
|
|
13
|
-
//
|
|
14
|
-
// envPlugin(['NODE_ENV', 'TAMAGUI_TARGET', 'ENABLE_RSC']),
|
|
15
|
-
// viteCommonjs(),
|
|
16
|
-
],
|
|
17
|
-
define: {
|
|
18
|
-
// reanimated support
|
|
19
|
-
"global.__x": {},
|
|
20
|
-
_frameTimestamp: void 0,
|
|
21
|
-
_WORKLET: false,
|
|
22
|
-
...process.env.NODE_ENV !== "test" && {
|
|
23
|
-
"process.env.TAMAGUI_TARGET": JSON.stringify(
|
|
24
|
-
process.env.TAMAGUI_TARGET || "web"
|
|
25
|
-
),
|
|
26
|
-
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || env.mode),
|
|
27
|
-
"process.env.ENABLE_RSC": JSON.stringify(process.env.ENABLE_RSC || ""),
|
|
28
|
-
"process.env.ENABLE_STEPS": JSON.stringify(process.env.ENABLE_STEPS || ""),
|
|
29
|
-
"process.env.IS_STATIC": JSON.stringify(false)
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
// build: {
|
|
33
|
-
// commonjsOptions: {
|
|
34
|
-
// transformMixedEsModules: true,
|
|
35
|
-
// },
|
|
36
|
-
// },
|
|
37
|
-
ssr: {
|
|
38
|
-
noExternal: noExternalSSR
|
|
39
|
-
},
|
|
40
|
-
optimizeDeps: {
|
|
41
|
-
// disabled: false,
|
|
42
|
-
include: ["styleq", "react-native-reanimated"],
|
|
43
|
-
esbuildOptions: {
|
|
44
|
-
jsx: "transform",
|
|
45
|
-
// plugins: [
|
|
46
|
-
// esbuildCommonjs([
|
|
47
|
-
// 'styleq',
|
|
48
|
-
// 'inline-style-prefixer',
|
|
49
|
-
// 'create-react-class',
|
|
50
|
-
// 'copy-to-clipboard',
|
|
51
|
-
// ]),
|
|
52
|
-
// ],
|
|
53
|
-
resolveExtensions: [
|
|
54
|
-
".web.js",
|
|
55
|
-
".web.ts",
|
|
56
|
-
".web.tsx",
|
|
57
|
-
".js",
|
|
58
|
-
".jsx",
|
|
59
|
-
".json",
|
|
60
|
-
".ts",
|
|
61
|
-
".tsx",
|
|
62
|
-
".mjs"
|
|
63
|
-
],
|
|
64
|
-
loader: {
|
|
65
|
-
".js": "jsx"
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
resolve: {
|
|
70
|
-
// for once it extracts
|
|
71
|
-
// mainFields: ['module:jsx', 'module', 'jsnext:main', 'jsnext', 'main'],
|
|
72
|
-
extensions: [
|
|
73
|
-
".web.js",
|
|
74
|
-
".web.ts",
|
|
75
|
-
".web.tsx",
|
|
76
|
-
".js",
|
|
77
|
-
".jsx",
|
|
78
|
-
".json",
|
|
79
|
-
".ts",
|
|
80
|
-
".tsx",
|
|
81
|
-
".mjs"
|
|
82
|
-
],
|
|
83
|
-
alias: {
|
|
84
|
-
"react-native/Libraries/Renderer/shims/ReactFabric": "@tamagui/proxy-worm",
|
|
85
|
-
"react-native/Libraries/Utilities/codegenNativeComponent": "@tamagui/proxy-worm",
|
|
86
|
-
"react-native-svg": "@tamagui/react-native-svg",
|
|
87
|
-
"react-native": "react-native-web",
|
|
88
|
-
...options.useReactNativeWebLite && {
|
|
89
|
-
"react-native": "react-native-web-lite",
|
|
90
|
-
"react-native-web": "react-native-web-lite"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
return plugin;
|
|
98
|
-
}
|
|
99
|
-
export {
|
|
100
|
-
tamaguiPlugin
|
|
101
|
-
};
|
|
1
|
+
function r(e){const t=[...new Set([...e.components,"tamagui","@tamagui/core"])],s=new RegExp(`${t.join("|")}|react-native|expo-linear-gradient`,"ig");return{name:"tamagui-base",enforce:"pre",config(a,i){return{plugins:[],define:{"global.__x":{},_frameTimestamp:void 0,_WORKLET:!1,...process.env.NODE_ENV!=="test"&&{"process.env.TAMAGUI_TARGET":JSON.stringify(process.env.TAMAGUI_TARGET||"web"),"process.env.NODE_ENV":JSON.stringify(process.env.NODE_ENV||i.mode),"process.env.ENABLE_RSC":JSON.stringify(process.env.ENABLE_RSC||""),"process.env.ENABLE_STEPS":JSON.stringify(process.env.ENABLE_STEPS||""),"process.env.IS_STATIC":JSON.stringify(!1)}},ssr:{noExternal:s},optimizeDeps:{include:["styleq","react-native-reanimated"],esbuildOptions:{jsx:"transform",resolveExtensions:[".web.js",".web.ts",".web.tsx",".js",".jsx",".json",".ts",".tsx",".mjs"],loader:{".js":"jsx"}}},resolve:{extensions:[".web.js",".web.ts",".web.tsx",".js",".jsx",".json",".ts",".tsx",".mjs"],alias:{"react-native/Libraries/Renderer/shims/ReactFabric":"@tamagui/proxy-worm","react-native/Libraries/Utilities/codegenNativeComponent":"@tamagui/proxy-worm","react-native-svg":"@tamagui/react-native-svg","react-native":"react-native-web",...e.useReactNativeWebLite&&{"react-native":"react-native-web-lite","react-native-web":"react-native-web-lite"}}}}}}}export{r as tamaguiPlugin};
|
|
102
2
|
//# sourceMappingURL=plugin.js.map
|