From 5b60cb9b7a1fa13ec6aaeee1782f71bd8e8d3893 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Sun, 7 Jan 2024 23:41:19 +0000 Subject: [PATCH] fix(types): support `node16` and `bundler` Currently, the TypeScript types for this module only support the `node10` TypeScript module resolution mode. Now, `node10`, `node16` (ESM only), and `bundler` all work, according to https://arethetypeswrong.github.io/ Fixes: https://github.com/mermaid-js/mermaid-cli/issues/628 Fixes: https://github.com/mermaid-js/mermaid-cli/issues/633 Co-authored-by: Andrew Shaw Care <54861+andrewshawcare@users.noreply.github.com> --- package.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index beb51f2b..2019501f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,14 @@ "engines": { "node": "^14.13 || >=16.0" }, - "exports": "./src/index.js", + "exports": { + ".": { + "import": { + "types": "./dist-types/src/index.d.ts", + "default": "./src/index.js" + } + } + }, "types": "./dist-types/src/index.d.ts", "scripts": { "prepare": "tsc && vite build",