From 9919afd1f42e115c4963f3cf2a19b60af07b810e Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 15 Feb 2023 17:24:30 +0100 Subject: [PATCH] fix: Webpack resolving of commonjs imports Signed-off-by: Ferdinand Thiessen --- package.json | 8 ++++---- rollup.config.mjs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index de1eb0d0..7bda0f2e 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,13 @@ "version": "4.0.0", "description": "", "types": "dist/index.d.ts", - "main": "dist/index.js", - "module": "dist/index.es.js", + "main": "dist/index.cjs", + "module": "dist/index.mjs", "type": "module", "exports": { ".": { - "import": "./dist/index.es.js", - "require": "./dist/index.js" + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" }, "./dist/index.css": { "import": "./dist/index.css", diff --git a/rollup.config.mjs b/rollup.config.mjs index 88af6d4e..d8b55112 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -36,12 +36,12 @@ export default [ input: 'lib/index.ts', output: [ { - file: 'dist/index.js', + file: 'dist/index.cjs', format: 'cjs', sourcemap: true }, { - file: 'dist/index.es.js', + file: 'dist/index.mjs', format: 'esm', sourcemap: true }