@tamagui/build 1.88.0 → 1.88.2
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 +30 -22
package/package.json
CHANGED
package/tamagui-build.js
CHANGED
|
@@ -195,10 +195,6 @@ async function buildJs() {
|
|
|
195
195
|
? {
|
|
196
196
|
entryPoints: [bundleNative],
|
|
197
197
|
bundle: true,
|
|
198
|
-
target: 'node16',
|
|
199
|
-
format: 'cjs',
|
|
200
|
-
jsx: 'automatic',
|
|
201
|
-
platform: 'node',
|
|
202
198
|
plugins: [
|
|
203
199
|
alias({
|
|
204
200
|
'@tamagui/web': require.resolve('@tamagui/web/native'),
|
|
@@ -252,29 +248,24 @@ async function buildJs() {
|
|
|
252
248
|
const start = Date.now()
|
|
253
249
|
|
|
254
250
|
const cjsConfig = {
|
|
251
|
+
format: 'cjs',
|
|
255
252
|
entryPoints: files,
|
|
256
253
|
outdir: flatOut ? 'dist' : 'dist/cjs',
|
|
257
254
|
bundle: shouldBundle,
|
|
258
255
|
external,
|
|
259
|
-
target: 'node16',
|
|
260
|
-
format: 'cjs',
|
|
261
|
-
jsx: 'automatic',
|
|
262
256
|
plugins: shouldBundleNodeModules ? [] : [externalPlugin],
|
|
263
257
|
minify: process.env.MINIFY ? true : false,
|
|
264
258
|
platform: 'node',
|
|
265
259
|
}
|
|
266
260
|
|
|
267
261
|
const esmConfig = {
|
|
262
|
+
format: 'esm',
|
|
268
263
|
entryPoints: files,
|
|
269
264
|
outdir: flatOut ? 'dist' : 'dist/esm',
|
|
270
265
|
bundle: shouldBundle,
|
|
271
266
|
external,
|
|
272
|
-
target: 'esnext',
|
|
273
|
-
jsx: 'automatic',
|
|
274
267
|
allowOverwrite: true,
|
|
275
|
-
format: 'esm',
|
|
276
268
|
minify: process.env.MINIFY ? true : false,
|
|
277
|
-
platform: shouldBundle ? 'node' : 'neutral',
|
|
278
269
|
}
|
|
279
270
|
|
|
280
271
|
return await Promise.all([
|
|
@@ -395,6 +386,32 @@ async function esbuildWriteIfChanged(
|
|
|
395
386
|
if (!shouldWatch && !platform) {
|
|
396
387
|
return await esbuild.build(opts)
|
|
397
388
|
}
|
|
389
|
+
|
|
390
|
+
// compat with jsx and hermes back a few versions generally:
|
|
391
|
+
/** @type { import('esbuild').BuildOptions } */
|
|
392
|
+
const nativeEsbuildSettings = {
|
|
393
|
+
target: 'node16',
|
|
394
|
+
format: 'cjs',
|
|
395
|
+
supported: {
|
|
396
|
+
'logical-assignment': false
|
|
397
|
+
},
|
|
398
|
+
jsx: 'automatic',
|
|
399
|
+
platform: 'node',
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/** @type { import('esbuild').BuildOptions } */
|
|
403
|
+
const webEsbuildSettings = {
|
|
404
|
+
target: 'esnext',
|
|
405
|
+
jsx: 'automatic',
|
|
406
|
+
platform: shouldBundle ? 'node' : 'neutral',
|
|
407
|
+
tsconfigRaw: {
|
|
408
|
+
compilerOptions: {
|
|
409
|
+
paths: {
|
|
410
|
+
'react-native': ['react-native-web'],
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
}
|
|
398
415
|
|
|
399
416
|
const built = await esbuild.build({
|
|
400
417
|
...opts,
|
|
@@ -428,17 +445,8 @@ async function esbuildWriteIfChanged(
|
|
|
428
445
|
sourcemap: true,
|
|
429
446
|
sourcesContent: false,
|
|
430
447
|
logLevel: 'error',
|
|
431
|
-
|
|
432
|
-
...
|
|
433
|
-
tsconfigRaw: {
|
|
434
|
-
compilerOptions: {
|
|
435
|
-
paths: {
|
|
436
|
-
'react-native': ['react-native-web'],
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
|
-
},
|
|
440
|
-
}),
|
|
441
|
-
|
|
448
|
+
...platform === 'native' && nativeEsbuildSettings,
|
|
449
|
+
...platform === 'web' && webEsbuildSettings,
|
|
442
450
|
define: {
|
|
443
451
|
...(platform && {
|
|
444
452
|
'process.env.TAMAGUI_TARGET': `"${platform}"`,
|