From 51dc7d3d5b442cd3ce0e95d7a792336413fc3e33 Mon Sep 17 00:00:00 2001 From: Nicolas Polizzo Date: Fri, 15 Dec 2023 15:45:26 +0100 Subject: [PATCH] improve exports --- package.json | 18 +++++++++++------- tsconfig.json | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index abd3b0b..51ba2b0 100644 --- a/package.json +++ b/package.json @@ -15,16 +15,20 @@ "bars", "email" ], - "main": "./build/index.js", + "type": "module", + "main": "./build/umd/index.js", "module": "./build/esm/index.js", "types": "./build/types/index.d.ts", "exports": { - ".": { - "types": "./build/types/index.d.ts", - "require": "./build/index.js", - "import": "./build/esm/index.js", - "default": "./src/index.ts" - } + "node": { + "require": "./build/umd/index.js", + "import": "./build/esm/index.js" + }, + "types": "./build/types/index.d.ts", + "require": "./build/umd/index.js", + "import": "./build/esm/index.js", + "browser": "./build/umd/index.js", + "default": "./build/umd/index.js" }, "files": [ "build/**/*", diff --git a/tsconfig.json b/tsconfig.json index afed1da..0acfb7d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,8 +3,8 @@ "compilerOptions": { "rootDir": "src", "types": ["node", "jest", "mjml", "mjml-core", "mjml-validator"], - "outDir": "build", - "module": "commonjs", + "outDir": "build/umd", + "module": "umd", "target": "ESNext", "moduleResolution": "node", "esModuleInterop": true,