@tamagui/vite-plugin 1.1.12 → 1.1.13
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/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/native.js +186 -48
- package/dist/cjs/native.js.map +2 -2
- package/dist/cjs/plugin.js +2 -6
- package/dist/cjs/plugin.js.map +2 -2
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/native.js +184 -45
- package/dist/esm/native.js.map +2 -2
- package/dist/esm/plugin.js +2 -6
- package/dist/esm/plugin.js.map +2 -2
- package/package.json +16 -8
- package/src/extensions.ts +12 -0
- package/src/index.ts +1 -0
- package/src/native.ts +206 -115
- package/src/nativePrebuild.ts +99 -0
- package/src/plugin.ts +6 -11
- package/types/extensions.d.ts +2 -0
- package/types/extensions.d.ts.map +1 -0
- package/types/extract.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -0
- package/types/native.d.ts +1 -3
- package/types/native.d.ts.map +1 -0
- package/types/nativePrebuild.d.ts +2 -0
- package/types/nativePrebuild.d.ts.map +1 -0
- package/types/plugin.d.ts.map +1 -0
package/dist/cjs/index.js
CHANGED
|
@@ -18,4 +18,5 @@ module.exports = __toCommonJS(src_exports);
|
|
|
18
18
|
__reExport(src_exports, require("./plugin.js"), module.exports);
|
|
19
19
|
__reExport(src_exports, require("./extract.js"), module.exports);
|
|
20
20
|
__reExport(src_exports, require("./native.js"), module.exports);
|
|
21
|
+
__reExport(src_exports, require("./nativePrebuild.js"), module.exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './plugin.js'\nexport * from './extract.js'\nexport * from './native.js'\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,wBAAd;AACA,wBAAc,yBADd;AAEA,wBAAc,wBAFd;",
|
|
4
|
+
"sourcesContent": ["export * from './plugin.js'\nexport * from './extract.js'\nexport * from './native.js'\nexport * from './nativePrebuild.js'\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,wBAAd;AACA,wBAAc,yBADd;AAEA,wBAAc,wBAFd;AAGA,wBAAc,gCAHd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/native.js
CHANGED
|
@@ -18,51 +18,116 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var native_exports = {};
|
|
20
20
|
__export(native_exports, {
|
|
21
|
-
nativePlugin: () => nativePlugin
|
|
22
|
-
replaceCss: () => replaceCss,
|
|
23
|
-
replaceScript: () => replaceScript
|
|
21
|
+
nativePlugin: () => nativePlugin
|
|
24
22
|
});
|
|
25
23
|
module.exports = __toCommonJS(native_exports);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const preloadMarker = /"__VITE_PRELOAD__"/g;
|
|
31
|
-
const newCode = scriptCode.replace(preloadMarker, "void 0");
|
|
32
|
-
const inlined = html.replace(
|
|
33
|
-
reScript,
|
|
34
|
-
(_, beforeSrc, afterSrc) => `<script${beforeSrc}${afterSrc}>
|
|
35
|
-
${newCode}
|
|
36
|
-
</script>`
|
|
37
|
-
);
|
|
38
|
-
return removeViteModuleLoader ? _removeViteModuleLoader(inlined) : inlined;
|
|
39
|
-
}
|
|
40
|
-
function replaceCss(html, scriptFilename, scriptCode) {
|
|
41
|
-
const reCss = new RegExp(`<link[^>]*? href="[./]*${scriptFilename}"[^>]*?>`);
|
|
42
|
-
const inlined = html.replace(reCss, `<style>
|
|
43
|
-
${scriptCode}
|
|
44
|
-
</style>`);
|
|
45
|
-
return inlined;
|
|
46
|
-
}
|
|
47
|
-
const warnNotInlined = (filename) => console.warn(`WARNING: asset not inlined: ${filename}`);
|
|
24
|
+
var import_promises = require("fs/promises");
|
|
25
|
+
var import_path = require("path");
|
|
26
|
+
var import_vite_plugin_flow = require("@bunchtogether/vite-plugin-flow");
|
|
27
|
+
var import_extensions = require("./extensions.js");
|
|
48
28
|
function nativePlugin() {
|
|
49
29
|
return {
|
|
50
|
-
name: "
|
|
30
|
+
name: "tamagui-native",
|
|
31
|
+
enforce: "post",
|
|
51
32
|
config: (config) => {
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
52
34
|
if (!config.build)
|
|
53
35
|
config.build = {};
|
|
36
|
+
config.build.modulePreload = { polyfill: false };
|
|
54
37
|
config.build.assetsInlineLimit = 1e8;
|
|
55
38
|
config.build.chunkSizeWarningLimit = 1e8;
|
|
56
39
|
config.build.cssCodeSplit = false;
|
|
57
40
|
config.build.reportCompressedSize = false;
|
|
58
41
|
config.base = void 0;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
42
|
+
config.resolve ?? (config.resolve = {});
|
|
43
|
+
config.resolve.extensions = import_extensions.extensions;
|
|
44
|
+
(_a = config.resolve).alias ?? (_a.alias = {});
|
|
45
|
+
config.resolve.alias = {
|
|
46
|
+
...config.resolve.alias,
|
|
47
|
+
"react-native/Libraries/Renderer/shims/ReactFabric": "react-native/Libraries/Renderer/shims/ReactFabric",
|
|
48
|
+
"react-native/Libraries/Utilities/codegenNativeComponent": "react-native/Libraries/Utilities/codegenNativeComponent",
|
|
49
|
+
"react-native-svg": "react-native-svg",
|
|
50
|
+
"react-native-web": "react-native",
|
|
51
|
+
"react-native": "react-native"
|
|
52
|
+
};
|
|
53
|
+
config.optimizeDeps ?? (config.optimizeDeps = {});
|
|
54
|
+
(_b = config.optimizeDeps).esbuildOptions ?? (_b.esbuildOptions = {});
|
|
55
|
+
config.optimizeDeps.esbuildOptions.resolveExtensions = import_extensions.extensions;
|
|
56
|
+
(_c = config.optimizeDeps.esbuildOptions).plugins ?? (_c.plugins = []);
|
|
57
|
+
config.optimizeDeps.esbuildOptions.plugins.push(
|
|
58
|
+
(0, import_vite_plugin_flow.esbuildFlowPlugin)(
|
|
59
|
+
/node_modules\/(react-native\/|@react-native\/assets)/,
|
|
60
|
+
(_) => "jsx"
|
|
61
|
+
)
|
|
62
|
+
);
|
|
63
|
+
(_d = config.optimizeDeps).include ?? (_d.include = []);
|
|
64
|
+
config.optimizeDeps.include.push("react-native");
|
|
65
|
+
(_e = config.optimizeDeps.esbuildOptions).loader ?? (_e.loader = {});
|
|
66
|
+
config.optimizeDeps.esbuildOptions.loader[".js"] = "jsx";
|
|
67
|
+
config.optimizeDeps.esbuildOptions.plugins.push({
|
|
68
|
+
name: "react-native-assets",
|
|
69
|
+
setup(build) {
|
|
70
|
+
build.onResolve(
|
|
71
|
+
{
|
|
72
|
+
filter: /\.(png|jpg|gif|webp)$/
|
|
73
|
+
},
|
|
74
|
+
async ({ path, namespace }) => {
|
|
75
|
+
return {
|
|
76
|
+
path: "",
|
|
77
|
+
external: true
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
(_f = config.build).rollupOptions ?? (_f.rollupOptions = {});
|
|
84
|
+
config.build.rollupOptions.input = "/Users/n8/tamagui/apps/kitchen-sink/src/index.tsx";
|
|
85
|
+
(_g = config.build.rollupOptions).output ?? (_g.output = {});
|
|
86
|
+
(_h = config.build.rollupOptions).plugins ?? (_h.plugins = []);
|
|
87
|
+
config.build.rollupOptions.external = ["react-native", "react", "react/jsx-runtime"];
|
|
88
|
+
if (!Array.isArray(config.build.rollupOptions.plugins)) {
|
|
89
|
+
throw `x`;
|
|
90
|
+
}
|
|
91
|
+
if (process.env.DEBUG) {
|
|
92
|
+
console.log("config..", config);
|
|
93
|
+
}
|
|
94
|
+
config.build.commonjsOptions = {
|
|
95
|
+
include: /node_modules\/react\//
|
|
96
|
+
};
|
|
97
|
+
config.build.rollupOptions.plugins.push({
|
|
98
|
+
name: `swap-react-native`,
|
|
99
|
+
async load(id) {
|
|
100
|
+
if (id.endsWith("react-native/index.js")) {
|
|
101
|
+
const bundled = await (0, import_promises.readFile)(
|
|
102
|
+
(0, import_path.join)(process.cwd(), "react-native.js"),
|
|
103
|
+
"utf-8"
|
|
104
|
+
);
|
|
105
|
+
const code = bundled;
|
|
106
|
+
return {
|
|
107
|
+
code: `
|
|
108
|
+
const run = () => {
|
|
109
|
+
${bundled.replace(
|
|
110
|
+
`module.exports = require_react_native();`,
|
|
111
|
+
`return require_react_native();`
|
|
112
|
+
)}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const RN = run()
|
|
116
|
+
|
|
117
|
+
${RNExportNames.map(
|
|
118
|
+
(name) => (
|
|
119
|
+
// adding exports
|
|
120
|
+
`export const ${name} = RN.${name}`
|
|
121
|
+
)
|
|
122
|
+
).join("\n")}
|
|
123
|
+
|
|
124
|
+
`
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
63
129
|
const updateOutputOptions = (out) => {
|
|
64
130
|
out.inlineDynamicImports = true;
|
|
65
|
-
console.log("adding manualChunks = undefined");
|
|
66
131
|
out.manualChunks = void 0;
|
|
67
132
|
};
|
|
68
133
|
if (Array.isArray(config.build.rollupOptions.output)) {
|
|
@@ -71,27 +136,100 @@ function nativePlugin() {
|
|
|
71
136
|
} else {
|
|
72
137
|
updateOutputOptions(config.build.rollupOptions.output);
|
|
73
138
|
}
|
|
74
|
-
},
|
|
75
|
-
enforce: "post",
|
|
76
|
-
generateBundle: (_, bundle) => {
|
|
77
|
-
const inlinePattern = [];
|
|
78
|
-
const jsExtensionTest = /\.[mc]?js$/;
|
|
79
|
-
const htmlFiles = Object.keys(bundle).filter((i) => i.endsWith(".html"));
|
|
80
|
-
const cssAssets = Object.keys(bundle).filter((i) => i.endsWith(".css"));
|
|
81
|
-
const jsAssets = Object.keys(bundle).filter((i) => jsExtensionTest.test(i));
|
|
82
|
-
const bundlesToDelete = [];
|
|
83
|
-
console.log("bundle", bundle);
|
|
84
139
|
}
|
|
85
140
|
};
|
|
86
141
|
}
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
142
|
+
const RNExportNames = [
|
|
143
|
+
"AccessibilityInfo",
|
|
144
|
+
"ActivityIndicator",
|
|
145
|
+
"Button",
|
|
146
|
+
"DatePickerIOS",
|
|
147
|
+
"DrawerLayoutAndroid",
|
|
148
|
+
"FlatList",
|
|
149
|
+
"Image",
|
|
150
|
+
"ImageBackground",
|
|
151
|
+
"InputAccessoryView",
|
|
152
|
+
"KeyboardAvoidingView",
|
|
153
|
+
"MaskedViewIOS",
|
|
154
|
+
"Modal",
|
|
155
|
+
"Pressable",
|
|
156
|
+
"ProgressBarAndroid",
|
|
157
|
+
"ProgressViewIOS",
|
|
158
|
+
"RefreshControl",
|
|
159
|
+
"SafeAreaView",
|
|
160
|
+
"ScrollView",
|
|
161
|
+
"SectionList",
|
|
162
|
+
"Slider",
|
|
163
|
+
"StatusBar",
|
|
164
|
+
"Switch",
|
|
165
|
+
"Text",
|
|
166
|
+
"TextInput",
|
|
167
|
+
"Touchable",
|
|
168
|
+
"TouchableHighlight",
|
|
169
|
+
"TouchableNativeFeedback",
|
|
170
|
+
"TouchableOpacity",
|
|
171
|
+
"TouchableWithoutFeedback",
|
|
172
|
+
"View",
|
|
173
|
+
"VirtualizedList",
|
|
174
|
+
"VirtualizedSectionList",
|
|
175
|
+
"ActionSheetIOS",
|
|
176
|
+
"Alert",
|
|
177
|
+
"Animated",
|
|
178
|
+
"Appearance",
|
|
179
|
+
"AppRegistry",
|
|
180
|
+
"AppState",
|
|
181
|
+
"AsyncStorage",
|
|
182
|
+
"BackHandler",
|
|
183
|
+
"Clipboard",
|
|
184
|
+
"DeviceInfo",
|
|
185
|
+
"DevSettings",
|
|
186
|
+
"Dimensions",
|
|
187
|
+
"Easing",
|
|
188
|
+
"findNodeHandle",
|
|
189
|
+
"I18nManager",
|
|
190
|
+
"ImagePickerIOS",
|
|
191
|
+
"InteractionManager",
|
|
192
|
+
"Keyboard",
|
|
193
|
+
"LayoutAnimation",
|
|
194
|
+
"Linking",
|
|
195
|
+
"LogBox",
|
|
196
|
+
"NativeDialogManagerAndroid",
|
|
197
|
+
"NativeEventEmitter",
|
|
198
|
+
"Networking",
|
|
199
|
+
"PanResponder",
|
|
200
|
+
"PermissionsAndroid",
|
|
201
|
+
"PixelRatio",
|
|
202
|
+
// 'PushNotificationIOS',
|
|
203
|
+
"Settings",
|
|
204
|
+
"Share",
|
|
205
|
+
"StyleSheet",
|
|
206
|
+
"Systrace",
|
|
207
|
+
"ToastAndroid",
|
|
208
|
+
"TurboModuleRegistry",
|
|
209
|
+
"UIManager",
|
|
210
|
+
"unstable_batchedUpdates",
|
|
211
|
+
"useColorScheme",
|
|
212
|
+
"useWindowDimensions",
|
|
213
|
+
"UTFSequence",
|
|
214
|
+
"Vibration",
|
|
215
|
+
"YellowBox",
|
|
216
|
+
"DeviceEventEmitter",
|
|
217
|
+
"DynamicColorIOS",
|
|
218
|
+
"NativeAppEventEmitter",
|
|
219
|
+
"NativeModules",
|
|
220
|
+
"Platform",
|
|
221
|
+
"PlatformColor",
|
|
222
|
+
"processColor",
|
|
223
|
+
"requireNativeComponent",
|
|
224
|
+
"RootTagContext"
|
|
225
|
+
// 'unstable_enableLogBox',
|
|
226
|
+
// 'ColorPropType',
|
|
227
|
+
// 'EdgeInsetsPropType',
|
|
228
|
+
// 'PointPropType',
|
|
229
|
+
// 'ViewPropTypes',
|
|
230
|
+
];
|
|
91
231
|
// Annotate the CommonJS export names for ESM import in node:
|
|
92
232
|
0 && (module.exports = {
|
|
93
|
-
nativePlugin
|
|
94
|
-
replaceCss,
|
|
95
|
-
replaceScript
|
|
233
|
+
nativePlugin
|
|
96
234
|
});
|
|
97
235
|
//# sourceMappingURL=native.js.map
|
package/dist/cjs/native.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/native.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
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 //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AA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -22,9 +22,7 @@ __export(plugin_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(plugin_exports);
|
|
24
24
|
function tamaguiPlugin(options) {
|
|
25
|
-
const components = [
|
|
26
|
-
.../* @__PURE__ */ new Set([...options.components, "tamagui", "@tamagui/core"])
|
|
27
|
-
];
|
|
25
|
+
const components = [.../* @__PURE__ */ new Set([...options.components, "tamagui", "@tamagui/core"])];
|
|
28
26
|
const noExternalSSR = new RegExp(
|
|
29
27
|
`${components.join("|")}|react-native|expo-linear-gradient`,
|
|
30
28
|
"ig"
|
|
@@ -50,9 +48,7 @@ function tamaguiPlugin(options) {
|
|
|
50
48
|
),
|
|
51
49
|
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || env.mode),
|
|
52
50
|
"process.env.ENABLE_RSC": JSON.stringify(process.env.ENABLE_RSC || ""),
|
|
53
|
-
"process.env.ENABLE_STEPS": JSON.stringify(
|
|
54
|
-
process.env.ENABLE_STEPS || ""
|
|
55
|
-
),
|
|
51
|
+
"process.env.ENABLE_STEPS": JSON.stringify(process.env.ENABLE_STEPS || ""),
|
|
56
52
|
"process.env.IS_STATIC": JSON.stringify(false)
|
|
57
53
|
}
|
|
58
54
|
},
|
package/dist/cjs/plugin.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/plugin.ts"],
|
|
4
|
-
"sourcesContent": ["import type { TamaguiOptions } from '@tamagui/static'\nimport type { Plugin } from 'vite'\n\n/**\n * For some reason envPlugin doesnt work for vitest, but process: { env: {} } breaks vitest\n */\n\nexport function tamaguiPlugin(\n options: TamaguiOptions & {\n useReactNativeWebLite?: boolean\n }
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,cACd,SAGQ;AACR,QAAM,aAAa
|
|
4
|
+
"sourcesContent": ["import type { TamaguiOptions } from '@tamagui/static'\nimport type { Plugin } from 'vite'\n\n/**\n * For some reason envPlugin doesnt work for vitest, but process: { env: {} } breaks vitest\n */\n\nexport function tamaguiPlugin(\n options: TamaguiOptions & {\n useReactNativeWebLite?: boolean\n }\n): Plugin {\n const components = [...new Set([...options.components, 'tamagui', '@tamagui/core'])]\n const noExternalSSR = new RegExp(\n `${components.join('|')}|react-native|expo-linear-gradient`,\n 'ig'\n )\n\n const plugin: Plugin = {\n name: 'tamagui-base',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n plugins: [\n //\n // envPlugin(['NODE_ENV', 'TAMAGUI_TARGET', 'ENABLE_RSC']),\n // viteCommonjs(),\n ],\n define: {\n // reanimated support\n 'global.__x': {},\n _frameTimestamp: undefined,\n _WORKLET: false,\n ...(process.env.NODE_ENV !== 'test' && {\n 'process.env.TAMAGUI_TARGET': JSON.stringify(\n process.env.TAMAGUI_TARGET || 'web'\n ),\n 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || env.mode),\n 'process.env.ENABLE_RSC': JSON.stringify(process.env.ENABLE_RSC || ''),\n 'process.env.ENABLE_STEPS': JSON.stringify(process.env.ENABLE_STEPS || ''),\n 'process.env.IS_STATIC': JSON.stringify(false),\n }),\n },\n // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n noExternal: noExternalSSR,\n },\n optimizeDeps: {\n // disabled: false,\n include: ['styleq', 'react-native-reanimated'],\n esbuildOptions: {\n jsx: 'transform',\n // plugins: [\n // esbuildCommonjs([\n // 'styleq',\n // 'inline-style-prefixer',\n // 'create-react-class',\n // 'copy-to-clipboard',\n // ]),\n // ],\n resolveExtensions: [\n '.web.js',\n '.web.ts',\n '.web.tsx',\n '.js',\n '.jsx',\n '.json',\n '.ts',\n '.tsx',\n '.mjs',\n ],\n loader: {\n '.js': 'jsx',\n },\n },\n },\n resolve: {\n // for once it extracts\n // mainFields: ['module:jsx', 'module', 'jsnext:main', 'jsnext', 'main'],\n extensions: [\n '.web.js',\n '.web.ts',\n '.web.tsx',\n '.js',\n '.jsx',\n '.json',\n '.ts',\n '.tsx',\n '.mjs',\n ],\n alias: {\n 'react-native/Libraries/Renderer/shims/ReactFabric': '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent':\n '@tamagui/proxy-worm',\n 'react-native-svg': '@tamagui/react-native-svg',\n 'react-native': 'react-native-web',\n ...(options.useReactNativeWebLite && {\n 'react-native': 'react-native-web-lite',\n 'react-native-web': 'react-native-web-lite',\n }),\n },\n },\n }\n },\n }\n\n return plugin\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,cACd,SAGQ;AACR,QAAM,aAAa,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,QAAQ,YAAY,WAAW,eAAe,CAAC,CAAC;AACnF,QAAM,gBAAgB,IAAI;AAAA,IACxB,GAAG,WAAW,KAAK,GAAG;AAAA,IACtB;AAAA,EACF;AAEA,QAAM,SAAiB;AAAA,IACrB,MAAM;AAAA,IACN,SAAS;AAAA,IAET,OAAO,YAAY,KAAK;AACtB,aAAO;AAAA,QACL,SAAS;AAAA;AAAA;AAAA;AAAA,QAIT;AAAA,QACA,QAAQ;AAAA;AAAA,UAEN,cAAc,CAAC;AAAA,UACf,iBAAiB;AAAA,UACjB,UAAU;AAAA,UACV,GAAI,QAAQ,IAAI,aAAa,UAAU;AAAA,YACrC,8BAA8B,KAAK;AAAA,cACjC,QAAQ,IAAI,kBAAkB;AAAA,YAChC;AAAA,YACA,wBAAwB,KAAK,UAAU,QAAQ,IAAI,YAAY,IAAI,IAAI;AAAA,YACvE,0BAA0B,KAAK,UAAU,QAAQ,IAAI,cAAc,EAAE;AAAA,YACrE,4BAA4B,KAAK,UAAU,QAAQ,IAAI,gBAAgB,EAAE;AAAA,YACzE,yBAAyB,KAAK,UAAU,KAAK;AAAA,UAC/C;AAAA,QACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMA,KAAK;AAAA,UACH,YAAY;AAAA,QACd;AAAA,QACA,cAAc;AAAA;AAAA,UAEZ,SAAS,CAAC,UAAU,yBAAyB;AAAA,UAC7C,gBAAgB;AAAA,YACd,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YASL,mBAAmB;AAAA,cACjB;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,YACA,QAAQ;AAAA,cACN,OAAO;AAAA,YACT;AAAA,UACF;AAAA,QACF;AAAA,QACA,SAAS;AAAA;AAAA;AAAA,UAGP,YAAY;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,OAAO;AAAA,YACL,qDAAqD;AAAA,YACrD,2DACE;AAAA,YACF,oBAAoB;AAAA,YACpB,gBAAgB;AAAA,YAChB,GAAI,QAAQ,yBAAyB;AAAA,cACnC,gBAAgB;AAAA,cAChB,oBAAoB;AAAA,YACtB;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './plugin.js'\nexport * from './extract.js'\nexport * from './native.js'\n"],
|
|
5
|
-
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
4
|
+
"sourcesContent": ["export * from './plugin.js'\nexport * from './extract.js'\nexport * from './native.js'\nexport * from './nativePrebuild.js'\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|