diff --git a/package.json b/package.json index d274f4f..b16ee7e 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "3.8.16", "description": "A Next.js Top Loading Bar component made using nprogress, works with Next.js 15 and Next.js 14 and React.", "main": "dist/index.js", + "module": "dist/index.mjs", "types": "dist/index.d.ts", "scripts": { "build-lib": "tsup", @@ -11,9 +12,21 @@ "typecheck": "tsc -p tsconfig.json" }, "exports": { - ".": "./dist/index.js", - "./app": "./dist/app.js", - "./pages": "./dist/pages.js" + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./app": { + "import": "./dist/app.mjs", + "require": "./dist/app.js", + "types": "./dist/app.d.ts" + }, + "./pages": { + "import": "./dist/pages.mjs", + "require": "./dist/pages.js", + "types": "./dist/pages.d.ts" + } }, "funding": { "url": "https://buymeacoffee.com/thesgj" diff --git a/tsup.config.ts b/tsup.config.ts index 856277e..8d904be 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -7,5 +7,5 @@ export const tsup: Options = { keepNames: true, sourcemap: true, minify: true, - format: ['cjs'], + format: ['cjs', 'esm'], };