Skip to content

Commit 8e3651a

Browse files
authored
Fix ReferenceError: module is not defined in ES module scope
This error happens when using Vitest (not sure about Jest) in an ESM environment.
1 parent bcba45c commit 8e3651a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
"react"
2424
],
2525
"main": "dist/index.js",
26+
"exports": {
27+
"import":"./dist/esm/index.js",
28+
"require": "./dist/index.js"
29+
},
2630
"typings": "dist/index.d.ts",
2731
"files": [
2832
"/dist",

0 commit comments

Comments
 (0)