Skip to content

Commit

Permalink
define build as library
Browse files Browse the repository at this point in the history
  • Loading branch information
thomcsmits committed Oct 3, 2024
1 parent 6054051 commit 9df5230
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
import path from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, "src/index.ts"),
name: "cellpop",
fileName: (format) => `index.${format}.js`
},
rollupOptions: {
external: ["react", "react-dom"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
},
},
plugins: [react()],
base: "/cellpop/"
base: "/cellpop/",
});

0 comments on commit 9df5230

Please sign in to comment.