Skip to content

Commit

Permalink
fix(nuxt): remove cjs (#742)
Browse files Browse the repository at this point in the history
* fix(nuxt): remove cjs

* chore: update changeset

---------

Co-authored-by: Gao Sun <gao@silverhand.io>
  • Loading branch information
wangsijie and gao-sun committed Jun 28, 2024
1 parent 6b1eb78 commit 22f3555
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .changeset/polite-turkeys-study.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 1 addition & 3 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 22f3555

Please sign in to comment.