diff --git a/.changeset/brown-dots-think.md b/.changeset/brown-dots-think.md new file mode 100644 index 0000000..d80288a --- /dev/null +++ b/.changeset/brown-dots-think.md @@ -0,0 +1,5 @@ +--- +"@wethegit/react-hooks": patch +--- + +fix: support commonjs diff --git a/packages/wethegit-react-hooks/package.json b/packages/wethegit-react-hooks/package.json index a2e9dd8..3ab0986 100644 --- a/packages/wethegit-react-hooks/package.json +++ b/packages/wethegit-react-hooks/package.json @@ -13,7 +13,8 @@ "import": { "types": "./dist/main.d.ts", "default": "./dist/react-hooks.js" - } + }, + "require": "./dist/react-hooks.cjs" } }, "scripts": { diff --git a/packages/wethegit-react-hooks/vite.config.ts b/packages/wethegit-react-hooks/vite.config.ts index 447d3a7..69c0f2d 100644 --- a/packages/wethegit-react-hooks/vite.config.ts +++ b/packages/wethegit-react-hooks/vite.config.ts @@ -14,7 +14,7 @@ export default defineConfig({ // eslint-disable-next-line no-undef entry: resolve(__dirname, "src/lib/index.ts"), name: "ReactHooks", - formats: ["es"], + formats: ["es", "cjs"], }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled