Skip to content

Commit 25f3b6c

Browse files
authored
fix(build): apply resolved tsconfig to dts (#462)
1 parent e8cb0ef commit 25f3b6c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"unbuild": "^3.0.1"
4545
},
4646
"peerDependencies": {
47-
"nuxi": "^3.17.2"
47+
"nuxi": "^3.17.2",
48+
"typescript": "^5.6.3"
4849
},
4950
"devDependencies": {
5051
"@nuxt/eslint-config": "^0.7.4",

src/commands/build.ts

+11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type { NuxtModule } from '@nuxt/schema'
1313
import { findExports, resolvePath } from 'mlly'
1414
import type { ESMExport } from 'mlly'
1515
import { defineCommand } from 'citty'
16+
import { convertCompilerOptionsFromJson } from 'typescript'
1617

1718
import { name, version } from '../../package.json'
1819

@@ -83,6 +84,8 @@ export default defineCommand({
8384
'@nuxt/kit',
8485
'@nuxt/kit-nightly',
8586
'@nuxt/kit-edge',
87+
'#app',
88+
'#app/nuxt',
8689
'nuxt',
8790
'nuxt-nightly',
8891
'nuxt-edge',
@@ -97,6 +100,14 @@ export default defineCommand({
97100
})
98101
},
99102
async 'rollup:options'(ctx, options) {
103+
const [entry] = ctx.buildEntries
104+
const mergedCompilerOptions = defu({
105+
noEmit: false,
106+
paths: {
107+
'#app/nuxt': ['./node_modules/nuxt/dist/app/nuxt'],
108+
},
109+
}, ctx.options.rollup.dts.compilerOptions, await loadTSCompilerOptions(entry!.path))
110+
ctx.options.rollup.dts.compilerOptions = convertCompilerOptionsFromJson(mergedCompilerOptions, entry!.path).options
100111
options.plugins ||= []
101112
if (!Array.isArray(options.plugins))
102113
options.plugins = [options.plugins]

0 commit comments

Comments
 (0)