From 0fa3aa2e4043b58b13d138c5eeed50565f54bdde Mon Sep 17 00:00:00 2001 From: Andrew Bobkov Date: Fri, 27 Sep 2024 20:03:02 +0000 Subject: [PATCH] fix(icons-react): esm exports --- packages/icons-react/package.json | 18 +++++++++++++++--- packages/icons-react/rollup.config.mjs | 6 +++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/icons-react/package.json b/packages/icons-react/package.json index b7eb58fe49..b998e2cd89 100644 --- a/packages/icons-react/package.json +++ b/packages/icons-react/package.json @@ -17,9 +17,21 @@ "url": "git+https://github.com/tabler/tabler-icons.git", "directory": "packages/icons-react" }, - "main": "./dist/cjs/tabler-icons-react.cjs", - "types": "./dist/esm/tabler-icons-react.d.ts", - "module": "./dist/esm/tabler-icons-react.mjs", + "main": "./dist/cjs/tabler-icons-react.js", + "types": "./dist/cjs/tabler-icons-react.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/tabler-icons-react.d.mts", + "default": "./dist/esm/tabler-icons-react.mjs" + }, + "require": { + "types": "./dist/cjs/tabler-icons-react.d.ts", + "default": "./dist/cjs/tabler-icons-react.js" + } + } + }, "sideEffects": false, "files": [ "dist" diff --git a/packages/icons-react/rollup.config.mjs b/packages/icons-react/rollup.config.mjs index 09f7d364f2..144203f5e7 100644 --- a/packages/icons-react/rollup.config.mjs +++ b/packages/icons-react/rollup.config.mjs @@ -9,7 +9,7 @@ const inputs = ['./src/tabler-icons-react.ts']; const bundles = [ { format: 'cjs', - extension: 'cjs', + extension: 'js', inputs, }, { @@ -24,9 +24,9 @@ export default [ { input: inputs[0], output: [{ - file: `dist/esm/${outputFileName}.d.ts`, format: 'esm' + file: `dist/esm/${outputFileName}.d.mts`, format: 'esm' }, { - file: `dist/cjs/${outputFileName}.d.cts`, format: 'cjs' + file: `dist/cjs/${outputFileName}.d.ts`, format: 'cjs' }], plugins: [dts()], },