diff --git a/bili.config.base.ts b/bili.config.base.ts index 128d1d1..6177ea3 100644 --- a/bili.config.base.ts +++ b/bili.config.base.ts @@ -3,9 +3,14 @@ import type { Config } from "bili"; const config: Config = { plugins: { typescript2: { + useTsconfigDeclarationDir: true, tsconfigOverride: { include: ["src"], - exclude: ["**/*.test.ts"] + exclude: ["**/*.test.ts"], + compilerOptions: { + declaration: true, + declarationDir: "./dist/types" + } } } }, diff --git a/bili.config.community.ts b/bili.config.community.ts index ab0846e..b0a7f92 100644 --- a/bili.config.community.ts +++ b/bili.config.community.ts @@ -3,9 +3,14 @@ import type { Config } from "bili"; const config: Config = { plugins: { typescript2: { + useTsconfigDeclarationDir: true, tsconfigOverride: { include: ["src"], - exclude: ["**/*.test.ts"] + exclude: ["**/*.test.ts"], + compilerOptions: { + declaration: true, + declarationDir: "./dist/types" + } } } }, diff --git a/package.json b/package.json index e7ee032..ba91218 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "module": "dist/ad-notations.esm.js", "unpkg": "dist/ad-notations.umd.js", "jsdelivr": "dist/ad-notations.umd.js", + "types": "dist/types/index.d.ts", "keywords": [ "notations", "numbers"