From eaa9ffa3307b3f95fd1b66884069af9dd031462e Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Fri, 19 Nov 2021 09:29:20 +0100 Subject: [PATCH] [fix] add types field to exports (#6937) This will be needed when TS adds the new node module resolution algorithm. It also solves https://github.com/microsoft/TypeScript/issues/46860 on our end. Closes #6939 --- CHANGELOG.md | 1 + package.json | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c4a4ab92ea4..36dcaaee87a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Fix overly restrictive preprocessor types ([#6904](https://github.com/sveltejs/svelte/pull/6904)) * More specific typing for crossfade function - returns a tuple, not an array ([#6926](https://github.com/sveltejs/svelte/issues/6926)) +* Add `types` field to `exports` map ([#6939](https://github.com/sveltejs/svelte/issues/6939)) ## 3.44.1 diff --git a/package.json b/package.json index 5ddceacbceb3..c668f7d91dfa 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "exports": { "./package.json": "./package.json", ".": { + "types": "./types/runtime/index.d.ts", "browser": { "import": "./index.mjs", "require": "./index.js" @@ -34,22 +35,27 @@ "require": "./index.js" }, "./compiler": { + "types": "./types/compiler/index.d.ts", "import": "./compiler.mjs", "require": "./compiler.js" }, "./animate": { + "types": "./types/runtime/animate/index.d.ts", "import": "./animate/index.mjs", "require": "./animate/index.js" }, "./easing": { + "types": "./types/runtime/easing/index.d.ts", "import": "./easing/index.mjs", "require": "./easing/index.js" }, "./internal": { + "types": "./types/runtime/internal/index.d.ts", "import": "./internal/index.mjs", "require": "./internal/index.js" }, "./motion": { + "types": "./types/runtime/motion/index.d.ts", "import": "./motion/index.mjs", "require": "./motion/index.js" }, @@ -57,14 +63,17 @@ "require": "./register.js" }, "./store": { + "types": "./types/runtime/store/index.d.ts", "import": "./store/index.mjs", "require": "./store/index.js" }, "./transition": { + "types": "./types/runtime/transition/index.d.ts", "import": "./transition/index.mjs", "require": "./transition/index.js" }, "./ssr": { + "types": "./types/runtime/index.d.ts", "import": "./ssr.mjs", "require": "./ssr.js" }