From a39e76231a4203dc08799e3a26355ad7877615a8 Mon Sep 17 00:00:00 2001 From: Edric Date: Tue, 6 Apr 2021 20:45:19 +0800 Subject: [PATCH] [WIP] Add TypeScript declaration files to output Closes #150 --- bili.config.base.ts | 7 ++++++- bili.config.community.ts | 7 ++++++- package.json | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) 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"