From fa7a8b62b62a95238e533b1c0c75b1045bc9149e Mon Sep 17 00:00:00 2001 From: sunyiteng Date: Thu, 13 Mar 2025 17:07:24 +0800 Subject: [PATCH] feat: correct the esm cjs exports --- build.ts | 2 +- package.json | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build.ts b/build.ts index 0a3bba5f..3fd08f89 100644 --- a/build.ts +++ b/build.ts @@ -16,6 +16,6 @@ build({ build({ ...shared, - outfile: 'lib/index.esm.js', + outfile: 'lib/index.mjs', format: 'esm', }); diff --git a/package.json b/package.json index abdeb947..bcd2042d 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,15 @@ "description": "Thread-safe Helmet for React 16+ and friends", "sideEffects": false, "main": "./lib/index.js", - "module": "./lib/index.esm.js", + "module": "./lib/index.mjs", "typings": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "import": "./lib/index.mjs", + "require": "./lib/index.js" + } + }, "repository": "http://github.com/staylor/react-helmet-async", "author": "Scott Taylor ", "license": "Apache-2.0",