diff --git a/packages/jotai/package.json b/packages/jotai/package.json index 160c6e3..7ec3463 100644 --- a/packages/jotai/package.json +++ b/packages/jotai/package.json @@ -7,6 +7,18 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } + } + }, "keywords": [ "react", "state", diff --git a/packages/react-query/package.json b/packages/react-query/package.json index 5d7a985..8404386 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -5,7 +5,19 @@ "type": "module", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "jest --config jest.config.ts" + }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } + } }, "keywords": [ "react", diff --git a/packages/valtio/package.json b/packages/valtio/package.json index 6715570..c777327 100644 --- a/packages/valtio/package.json +++ b/packages/valtio/package.json @@ -7,6 +7,18 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } + } + }, "keywords": [ "react", "state", diff --git a/packages/zustand/package.json b/packages/zustand/package.json index 10ff1a8..8084261 100644 --- a/packages/zustand/package.json +++ b/packages/zustand/package.json @@ -7,6 +7,18 @@ "scripts": { "test": "jest --config jest.config.ts" }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } + } + }, "keywords": [ "react", "state", diff --git a/rollup.config.js b/rollup.config.js index 1451229..ccdcb53 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -76,7 +76,7 @@ module.exports = (args) => { return [ createDeclarationConfig(input, output), - createESMConfig(`${input}/src/index.ts`, `${output}/index.ems.js`), + createESMConfig(`${input}/src/index.ts`, `${output}/index.mjs`), createCommonJSConfig(`${input}/src/index.ts`, `${output}/index.cjs.js`), createUMDConfig( `${input}/src/index.ts`,