@tamagui/build 1.15.29 → 1.15.30

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.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/tamagui-build.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/build",
3
- "version": "1.15.29",
3
+ "version": "1.15.30",
4
4
  "bin": {
5
5
  "tamagui-build": "tamagui-build.js"
6
6
  },
@@ -18,6 +18,7 @@
18
18
  "execa": "^5.0.0",
19
19
  "fast-glob": "^3.2.11",
20
20
  "fs-extra": "^11.1.0",
21
+ "get-tsconfig": "^4.5.0",
21
22
  "lodash.debounce": "^4.0.8",
22
23
  "typescript": "^5.0.4"
23
24
  },
package/tamagui-build.js CHANGED
@@ -8,6 +8,7 @@ const fg = require('fast-glob')
8
8
  const createExternalPlugin = require('./externalNodePlugin')
9
9
  const debounce = require('lodash.debounce')
10
10
  const { dirname } = require('path')
11
+ const { getTsconfig } = require('get-tsconfig')
11
12
 
12
13
  const jsOnly = !!process.env.JS_ONLY
13
14
  const skipJS = !!(process.env.SKIP_JS || false)
@@ -119,9 +120,8 @@ async function buildTsc() {
119
120
  return
120
121
  }
121
122
 
122
- if (!(await fs.pathExists(`tsconfig.json`))) {
123
- throw new Error(`No tsconfig.json found`)
124
- }
123
+ const config = getTsconfig()
124
+ const baseUrl = config.compilerOptions?.baseUrl || '.'
125
125
 
126
126
  const targetDir = 'types'
127
127
  try {
@@ -130,7 +130,7 @@ async function buildTsc() {
130
130
  await fs.ensureDir(targetDir)
131
131
 
132
132
  const declarationToRootFlag = declarationToRoot ? ' --declarationDir ./' : ''
133
- const cmd = `tsc --baseUrl . --outDir ${targetDir} --rootDir src ${declarationToRootFlag}--emitDeclarationOnly --declarationMap`
133
+ const cmd = `tsc --baseUrl ${baseUrl} --outDir ${targetDir} --rootDir src ${declarationToRootFlag}--emitDeclarationOnly --declarationMap`
134
134
 
135
135
  // console.log('\x1b[2m$', `npx ${cmd}`)
136
136
  await exec('npx', cmd.split(' '))