From 5592f04565873413743d9c4dfbdb086938ea119f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Hon?= Date: Sat, 9 Apr 2022 15:34:28 +0200 Subject: [PATCH] Add package.json exports property (#94) * Add package.json exports property This allows modern build systems (vite) to properly use the correct module type (ESM). See https://github.com/sveltejs/kit/issues/928 for more details. --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 9fadb12..3177878 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,10 @@ "main": "dist/index.cjs.js", "module": "dist/index.esm.js", "typings": "dist/index.d.ts", + "exports": { + "import": "./dist/index.esm.js", + "require": "./dist/index.cjs.js" + }, "scripts": { "test": "ts-node node_modules/tape/bin/tape test/**/*.ts", "prepublishOnly": "npm test && npm run lint && npm run build",