diff --git a/.changeset/polite-turkeys-study.md b/.changeset/polite-turkeys-study.md new file mode 100644 index 00000000..28dec92c --- /dev/null +++ b/.changeset/polite-turkeys-study.md @@ -0,0 +1,8 @@ +--- +"@logto/nuxt": minor +--- + +remove commonjs export, fix non-default exports + +- The CJS build generated by `@nuxt/module-builder` only exports the default export, causing issues for users who want to use named exports. +- Nuxt stills uses the CJS build if certain fields are found, regardless of the `"type": "module"` field in `package.json`. Since Nuxt 3 uses ESM by default, we just remove the CJS export to avoid confusion. diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 220a5033..c765fc35 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -5,11 +5,9 @@ "exports": { ".": { "import": "./dist/module.mjs", - "types": "./dist/module.d.ts", - "require": "./dist/module.cjs" + "types": "./dist/module.d.ts" } }, - "main": "./dist/module.cjs", "types": "./dist/module.d.ts", "files": [ "dist"