diff --git a/vite.config.ts b/vite.config.ts index b67e4c9..dbcb505 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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/", }); \ No newline at end of file