Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
"$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
"assist": {
"actions": {
"source": {
Expand Down
6 changes: 1 addition & 5 deletions packages/plugin-dts/src/dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,8 @@ export async function generateDts(data: DtsGenOptions): Promise<void> {
(!rawCompilerOptions.declarationDir ||
normalize(rawCompilerOptions.declarationDir) !== resolvedDtsEmitPath)
) {
const info =
rawCompilerOptions.outDir && !rawCompilerOptions.declarationDir
? 'outDir'
: 'declarationDir';
throw Error(
`Please set ${info}: "${dtsEmitPath}" in ${color.underline(
`Please set "declarationDir": "${dtsEmitPath}" in ${color.underline(
tsconfigPath,
)} to keep it same as "dts.distPath" or "output.distPath.root" field in lib config.`,
);
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/integration/dts/build/tsconfig/rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineConfig({
dts: {
bundle: false,
build: true,
distPath: './dist/types',
},
}),
],
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/dts/build/tsconfig/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"baseUrl": "./",
"rootDir": "src",
"declaration": true
"declaration": true,
"outDir": "./dist/esm"
},
"include": ["src"],
"references": [
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/dts/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,9 @@ describe('dts when build: true', () => {
const stdoutOutput = result.stdout ? result.stdout.toString() : '';

expect(result.status).toBe(1);
expect(stdoutOutput).toContain('Please set declarationDir: "./dist/esm"');
expect(stdoutOutput).toContain(
'Please set "declarationDir": "./dist/types"',
);
});

test('should clean dts dist files', async () => {
Expand Down
Loading