From 371558243ad30d619e5aae0bddc6f279e6a5dfb8 Mon Sep 17 00:00:00 2001 From: immi Date: Sun, 10 Nov 2024 11:46:52 +0500 Subject: [PATCH] named exports working with cjs --- package.json | 1 + rollup.config.js | 6 ++++-- src/components/editor-open.tsx | 1 - src/index.ts | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e9dd1e1..f8b5254 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.4.0-alpha.2", "description": "Shadcn Theme Editor", "module": "dist/index.mjs", + "main": "dist/index.js", "types": "dist/index.d.ts", "repository": { "type": "git", diff --git a/rollup.config.js b/rollup.config.js index 8b0f4e0..baae8b2 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -25,12 +25,14 @@ export default [ { file: packageJson.main, format: "cjs", - // sourcemap: true, + exports: 'named', + sourcemap: true, }, { file: packageJson.module, format: "esm", - // sourcemap: true, + exports: 'named', + sourcemap: true, }, ], diff --git a/src/components/editor-open.tsx b/src/components/editor-open.tsx index e508a45..8a113ff 100644 --- a/src/components/editor-open.tsx +++ b/src/components/editor-open.tsx @@ -1,4 +1,3 @@ -"use client"; import { useState } from "react"; import { Sidebar } from "./sidebar"; import clsx from "clsx"; diff --git a/src/index.ts b/src/index.ts index 31ae406..de9f7f0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import "./tailwind.css"; import ShadcnThemeEditor from "./components/editor-open"; import { setSavedTheme } from "./lib/set-saved-theme"; -export { Icons } from "./components/icons"; +import { Icons } from "./components/icons"; -export { setSavedTheme }; +export { Icons, setSavedTheme }; export default ShadcnThemeEditor;