From a986bd68d7a466f7316133bf306d74b8babc22fa Mon Sep 17 00:00:00 2001 From: "Jiayi (Bob) Fan" <110795593+fushanbobfan@users.noreply.github.com> Date: Tue, 3 Nov 2026 06:54:44 -0800 Subject: [PATCH] fix: keep spec files' global declarations out of the published types (#3880) --- vite.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 74eb92c699..d31432f019 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -18,6 +18,9 @@ export default defineConfig({ // lib files it can't follow symbols such as Readonly into invokeOptions: { typescriptCompilerFolder: undefined }, }, + // Specs aren't part of the package. A global declaration in one, such as corpus.spec.ts's for import.meta.glob, + // would otherwise be copied into the types and apply to every project that installs docx + exclude: ["**/*.spec.ts"], // tsconfig.json removes comments, but the JSDoc in declarations is what users see in their editors compilerOptions: { removeComments: false }, afterBuild: () => {