@tamagui/build 1.139.4 → 1.140.1

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.
@@ -2,26 +2,26 @@
2
2
   RUN  v4.0.4 /Users/n8/tamagui/code/packages/build
3
3
 
4
4
  stdout | __tests__/integration.test.ts > tamagui-build integration test > should rebuild the package on file change when --watch is used
5
- Watch process output: built tamagui-build-test-watch-package in 65 ms
5
+ Watch process output: built tamagui-build-test-watch-package in 69 ms
6
6
 
7
7
  Initial build complete, modifying file...
8
8
 
9
9
  stdout | __tests__/integration.test.ts > tamagui-build integration test > should rebuild the package on file change when --watch is used
10
- Watch process output: built tamagui-build-test-watch-package in 342 ms
10
+ Watch process output: built tamagui-build-test-watch-package in 365 ms
11
11
 
12
12
  Rebuild after file modification complete
13
13
 
14
- ✓ __tests__/integration.test.ts (7 tests) 9376ms
15
- ✓ should build the package correctly  1339ms
16
- ✓ should bundle the package correctly  1164ms
17
- ✓ should skip mjs files when --skip-mjs is used  1225ms
18
- ✓ should ignore base URL when --ignore-base-url is used  1112ms
19
- ✓ should rebuild the package on file change when --watch is used  1267ms
20
- ✓ should generate correct platform-specific output  1081ms
21
- ✓ should minify the output when MINIFY=true is set  2169ms
14
+ ✓ __tests__/integration.test.ts (7 tests) 9282ms
15
+ ✓ should build the package correctly  1233ms
16
+ ✓ should bundle the package correctly  1063ms
17
+ ✓ should skip mjs files when --skip-mjs is used  1138ms
18
+ ✓ should ignore base URL when --ignore-base-url is used  1128ms
19
+ ✓ should rebuild the package on file change when --watch is used  1305ms
20
+ ✓ should generate correct platform-specific output  1147ms
21
+ ✓ should minify the output when MINIFY=true is set  2248ms
22
22
 
23
23
   Test Files  1 passed (1)
24
24
   Tests  7 passed (7)
25
-  Start at  15:07:12
26
-  Duration  9.49s (transform 35ms, setup 0ms, collect 40ms, tests 9.38s, environment 0ms, prepare 2ms)
25
+  Start at  09:11:43
26
+  Duration  9.40s (transform 39ms, setup 0ms, collect 45ms, tests 9.28s, environment 0ms, prepare 2ms)
27
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/build",
3
- "version": "1.139.4",
3
+ "version": "1.140.1",
4
4
  "bin": {
5
5
  "tamagui-build": "tamagui-build.js",
6
6
  "teesx": "./teesx.sh"
@@ -14,7 +14,7 @@
14
14
  "dependencies": {
15
15
  "@babel/core": "^7.25.2",
16
16
  "@swc/core": "^1.14.0",
17
- "@tamagui/babel-plugin-fully-specified": "1.139.4",
17
+ "@tamagui/babel-plugin-fully-specified": "1.140.1",
18
18
  "@types/fs-extra": "^9.0.13",
19
19
  "chokidar": "^3.5.2",
20
20
  "esbuild": "^0.25.11",
package/tamagui-build.js CHANGED
@@ -60,6 +60,12 @@ const pkgModuleJSX = pkg['module:jsx']
60
60
  const pkgTypes = Boolean(pkg.types || pkg.typings)
61
61
  const pkgRemoveSideEffects = pkg.removeSideEffects || false
62
62
 
63
+ // build config from package.json
64
+ const buildConfig = pkg['tamagui-build'] || {}
65
+ // if bundleOnly is set, only bundle those packages (old behavior)
66
+ // otherwise bundle ALL packages by default (new behavior)
67
+ const bundleOnly = buildConfig.bundleOnly || null
68
+
63
69
  const flatOut = [pkgMain, pkgModule, pkgModuleJSX].filter(Boolean).length === 1
64
70
 
65
71
  const avoidCJS = pkgMain?.endsWith('.js')
@@ -387,8 +393,11 @@ async function buildJs(allFiles) {
387
393
  skipNodeModulesBundle: true,
388
394
  })
389
395
 
396
+ // packages that must always stay external (need runtime access to files/wasm/native bindings)
397
+ const alwaysExternal = ['esbuild-wasm', '@swc/core']
398
+
390
399
  const bundlePlugin = {
391
- name: `external-most-modules`,
400
+ name: `bundle-all-modules`,
392
401
  setup(build) {
393
402
  // Alias esbuild to esbuild-wasm (but keep it external)
394
403
  build.onResolve({ filter: /^esbuild$/ }, (args) => {
@@ -402,16 +411,21 @@ async function buildJs(allFiles) {
402
411
  }
403
412
 
404
413
  if (!args.path.startsWith('.') && !args.path.startsWith('/')) {
405
- // Keep esbuild-wasm external (it needs access to WASM files)
406
- if (args.path === 'esbuild-wasm' || args.path.startsWith('esbuild-wasm/')) {
414
+ // Always keep these external (need runtime file access)
415
+ if (alwaysExternal.some(pkg => args.path === pkg || args.path.startsWith(pkg + '/'))) {
407
416
  return { external: true }
408
417
  }
409
- // Bundle mdx-bundler and its dependencies
410
- if (args.path === 'mdx-bundler' || args.path.startsWith('mdx-bundler/')) {
411
- return { external: false }
418
+
419
+ // If bundleOnly is set, only bundle those specific packages
420
+ if (bundleOnly) {
421
+ if (bundleOnly.some(pkg => args.path === pkg || args.path.startsWith(pkg + '/'))) {
422
+ return { external: false }
423
+ }
424
+ return { external: true }
412
425
  }
413
- // Externalize all other npm packages
414
- return { external: true }
426
+
427
+ // Default: bundle ALL packages
428
+ return { external: false }
415
429
  }
416
430
  })
417
431
  },