@tamagui/build 1.74.3 → 1.74.5
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/package.json +1 -1
- package/tamagui-build.js +52 -56
package/package.json
CHANGED
package/tamagui-build.js
CHANGED
|
@@ -194,7 +194,7 @@ async function buildJs() {
|
|
|
194
194
|
'@tamagui/web': require.resolve('@tamagui/web/native'),
|
|
195
195
|
|
|
196
196
|
// for test mode we want real react-native
|
|
197
|
-
|
|
197
|
+
...(!bundleNativeTest && {
|
|
198
198
|
'react-native': require.resolve('@tamagui/fake-react-native'),
|
|
199
199
|
'react-native/Libraries/Renderer/shims/ReactFabric': require.resolve(
|
|
200
200
|
'@tamagui/fake-react-native'
|
|
@@ -202,23 +202,27 @@ async function buildJs() {
|
|
|
202
202
|
'react-native/Libraries/Renderer/shims/ReactNative': require.resolve(
|
|
203
203
|
'@tamagui/fake-react-native'
|
|
204
204
|
),
|
|
205
|
-
},
|
|
205
|
+
}),
|
|
206
206
|
|
|
207
207
|
'react-native/Libraries/Pressability/Pressability': require.resolve(
|
|
208
208
|
'@tamagui/fake-react-native'
|
|
209
209
|
),
|
|
210
|
-
|
|
210
|
+
|
|
211
211
|
'react-native/Libraries/Pressability/usePressability': require.resolve(
|
|
212
212
|
'@tamagui/fake-react-native/idFn'
|
|
213
213
|
),
|
|
214
|
-
|
|
214
|
+
|
|
215
215
|
'react-native-safe-area-context': require.resolve(
|
|
216
216
|
'@tamagui/fake-react-native'
|
|
217
217
|
),
|
|
218
218
|
'react-native-gesture-handler': require.resolve('@tamagui/proxy-worm'),
|
|
219
219
|
}),
|
|
220
220
|
],
|
|
221
|
-
external: [
|
|
221
|
+
external: [
|
|
222
|
+
'react',
|
|
223
|
+
'react-dom',
|
|
224
|
+
bundleNativeTest ? 'react-native' : undefined,
|
|
225
|
+
].filter(Boolean),
|
|
222
226
|
resolveExtensions: [
|
|
223
227
|
'.native.ts',
|
|
224
228
|
'.native.tsx',
|
|
@@ -236,47 +240,46 @@ async function buildJs() {
|
|
|
236
240
|
: {}
|
|
237
241
|
|
|
238
242
|
const start = Date.now()
|
|
243
|
+
|
|
244
|
+
const cjsConfig = {
|
|
245
|
+
entryPoints: files,
|
|
246
|
+
outdir: flatOut ? 'dist' : 'dist/cjs',
|
|
247
|
+
bundle: shouldBundle,
|
|
248
|
+
external,
|
|
249
|
+
target: 'node16',
|
|
250
|
+
format: 'cjs',
|
|
251
|
+
jsx: 'automatic',
|
|
252
|
+
plugins: shouldBundleNodeModules ? [] : [externalPlugin],
|
|
253
|
+
minify: process.env.MINIFY ? true : false,
|
|
254
|
+
platform: 'node',
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const esmConfig = {
|
|
258
|
+
entryPoints: files,
|
|
259
|
+
outdir: flatOut ? 'dist' : 'dist/esm',
|
|
260
|
+
bundle: shouldBundle,
|
|
261
|
+
external,
|
|
262
|
+
target: 'esnext',
|
|
263
|
+
jsx: 'automatic',
|
|
264
|
+
allowOverwrite: true,
|
|
265
|
+
format: 'esm',
|
|
266
|
+
minify: process.env.MINIFY ? true : false,
|
|
267
|
+
platform: shouldBundle ? 'node' : 'neutral',
|
|
268
|
+
}
|
|
269
|
+
|
|
239
270
|
return await Promise.all([
|
|
240
271
|
// web output to cjs
|
|
241
272
|
pkgMain
|
|
242
|
-
? esbuildWriteIfChanged(
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
outdir: flatOut ? 'dist' : 'dist/cjs',
|
|
246
|
-
bundle: shouldBundle,
|
|
247
|
-
external,
|
|
248
|
-
target: 'node16',
|
|
249
|
-
format: 'cjs',
|
|
250
|
-
jsx: 'automatic',
|
|
251
|
-
plugins: shouldBundleNodeModules ? [] : [externalPlugin],
|
|
252
|
-
minify: process.env.MINIFY ? true : false,
|
|
253
|
-
platform: 'node',
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
platform: 'web',
|
|
257
|
-
}
|
|
258
|
-
)
|
|
273
|
+
? esbuildWriteIfChanged(cjsConfig, {
|
|
274
|
+
platform: 'web',
|
|
275
|
+
})
|
|
259
276
|
: null,
|
|
260
277
|
|
|
261
278
|
// native output to cjs
|
|
262
279
|
pkgMain
|
|
263
|
-
? esbuildWriteIfChanged(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
outdir: flatOut ? 'dist' : 'dist/cjs',
|
|
267
|
-
bundle: shouldBundle,
|
|
268
|
-
external,
|
|
269
|
-
target: 'node16',
|
|
270
|
-
format: 'cjs',
|
|
271
|
-
jsx: 'automatic',
|
|
272
|
-
plugins: shouldBundleNodeModules ? [] : [externalPlugin],
|
|
273
|
-
minify: process.env.MINIFY ? true : false,
|
|
274
|
-
platform: 'node',
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
platform: 'native',
|
|
278
|
-
}
|
|
279
|
-
)
|
|
280
|
+
? esbuildWriteIfChanged(cjsConfig, {
|
|
281
|
+
platform: 'native',
|
|
282
|
+
})
|
|
280
283
|
: null,
|
|
281
284
|
|
|
282
285
|
// for tests to load native-mode from node
|
|
@@ -308,23 +311,16 @@ async function buildJs() {
|
|
|
308
311
|
|
|
309
312
|
// web output to esm
|
|
310
313
|
pkgModule
|
|
311
|
-
? esbuildWriteIfChanged(
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
minify: process.env.MINIFY ? true : false,
|
|
322
|
-
platform: shouldBundle ? 'node' : 'neutral',
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
platform: 'web',
|
|
326
|
-
}
|
|
327
|
-
)
|
|
314
|
+
? esbuildWriteIfChanged(esmConfig, {
|
|
315
|
+
platform: 'web',
|
|
316
|
+
})
|
|
317
|
+
: null,
|
|
318
|
+
|
|
319
|
+
// web output to esm
|
|
320
|
+
pkgModule
|
|
321
|
+
? esbuildWriteIfChanged(esmConfig, {
|
|
322
|
+
platform: 'native',
|
|
323
|
+
})
|
|
328
324
|
: null,
|
|
329
325
|
|
|
330
326
|
// jsx web
|