Skip to content

Commit 9b279c2

Browse files
authored
feat: Add custom tsconfig path resolution (#76)
* feat: add manual tsconfig path resolution * chore: fix language in TSDoc * chore: fix CI
1 parent 218d4a1 commit 9b279c2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/build/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export type Options = {
99
exclude?: Array<string>
1010
/** Directory where build output will be placed, e.g. `./dist` */
1111
outDir?: string
12+
/** Optional path to a custom tsconfig file, defaults to `./tsconfig.json` */
13+
tsconfigPath?: string
1214
/** Additional dependencies to externalize if not detected by `vite-plugin-externalize-deps` */
1315
externalDeps?: Array<string | RegExp>
1416
}

src/build/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ export const tanstackBuildConfig = (options) => {
1717
plugins: [
1818
externalizeDeps({ include: options.externalDeps ?? [] }),
1919
preserveDirectives(),
20-
tsconfigPaths(),
20+
tsconfigPaths({
21+
projects: options.tsconfigPath ? [options.tsconfigPath] : undefined,
22+
}),
2123
dts({
2224
outDir: `${outDir}/esm`,
2325
entryRoot: options.srcDir,
2426
include: options.srcDir,
2527
exclude: options.exclude,
28+
tsconfigPath: options.tsconfigPath,
2629
compilerOptions: {
2730
// @ts-expect-error
2831
module: 'esnext',
@@ -42,6 +45,7 @@ export const tanstackBuildConfig = (options) => {
4245
entryRoot: options.srcDir,
4346
include: options.srcDir,
4447
exclude: options.exclude,
48+
tsconfigPath: options.tsconfigPath,
4549
compilerOptions: {
4650
// @ts-expect-error
4751
module: 'commonjs',

0 commit comments

Comments
 (0)