From e8f815cb130a42ebdc729618ebc984f573dc1f62 Mon Sep 17 00:00:00 2001 From: Harsh Mandan Date: Tue, 2 Jan 2024 03:57:03 +0530 Subject: [PATCH] fix(package): add `exports` map to `package.json` (#77) Fixes #76 --- package.json | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index eb2d56f..04be67f 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,24 @@ "license": "MIT", "description": "Detect if an element is in the viewport using the Intersection Observer API", "author": "Eric Liu (https://github.com/metonym)", + "type": "module", "svelte": "./src/index.js", "main": "./src/index.js", "types": "./src/index.d.ts", - "type": "module", + "exports": { + ".": { + "types": "./types/index.d.ts", + "svelte": "./src/index.js" + }, + "./src/*.svelte": { + "types": "./src/*.svelte.d.ts", + "import": "./src/*.svelte" + }, + "./src/*": { + "types": "./src/*.d.ts", + "import": "./src/*.js" + } + }, "scripts": { "dev": "rollup -cw", "build": "rollup -c",