2022-04-25 04:33:00 +00:00
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
import path from "path";
|
|
|
|
import { defineConfig } from "vite";
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
|
|
plugins: [react()],
|
2022-05-09 20:56:23 +00:00
|
|
|
envPrefix: "NEXT_PUBLIC_",
|
2022-04-25 04:33:00 +00:00
|
|
|
build: {
|
|
|
|
lib: {
|
|
|
|
entry: path.resolve(__dirname, "src/index.ts"),
|
|
|
|
name: "Cal",
|
|
|
|
fileName: (format) => `Cal.${format}.js`,
|
|
|
|
},
|
|
|
|
rollupOptions: {
|
|
|
|
// make sure to externalize deps that shouldn't be bundled
|
|
|
|
// into your library
|
|
|
|
external: ["react", "react-dom"],
|
|
|
|
output: {
|
|
|
|
// Provide global variables to use in the UMD build
|
|
|
|
// for externalized deps
|
|
|
|
globals: {
|
|
|
|
react: "React",
|
|
|
|
"react-dom": "ReactDOM",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|