Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
hussedev committed Oct 18, 2024
1 parent d07c471 commit 7e39486
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/examples/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { Button } from "./button";
export { Callout } from "./callout";
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"version": "0.0.0",
"type": "module",
"types": "./dist/index.d.ts",
"main": "./dist/index.umd.ts",
"module": "./dist/index.es.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"files": [
"dist"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.es.ts",
"require": "./dist/index.umd.ts"
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"scripts": {
Expand Down
7 changes: 6 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ export default defineConfig({
lib: {
entry: resolve(__dirname, "./lib/index.ts"),
name: "gitcoin-ui",
fileName: (format) => `index.${format}.js`,
fileName: (format, filename) => {
const extension = format === "es" ? "mjs" : format;
return `${filename}.${extension}`;
},
formats: ["cjs", "es"],
},
rollupOptions: {
external: ["react", "react-dom", "tailwindcss"],
Expand All @@ -21,6 +25,7 @@ export default defineConfig({
"react-dom": "ReactDOM",
tailwindcss: "tailwindcss",
},
preserveModules: true,
},
},
sourcemap: true,
Expand Down

0 comments on commit 7e39486

Please sign in to comment.