-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathvite.config.ts
More file actions
29 lines (24 loc) · 775 Bytes
/
vite.config.ts
File metadata and controls
29 lines (24 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import typescript from "@rollup/plugin-typescript";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
import pkg from "./package.json";
const externals = Object.keys(pkg.peerDependencies);
export default defineConfig({
plugins: [react(), cssInjectedByJsPlugin({ topExecutionPriority: false })],
build: {
lib: {
entry: "src/index.tsx",
formats: ["cjs", "es"],
fileName: (format) => `index.${format}.js`,
},
rollupOptions: {
// Don't bundle react or react-dom
external: externals,
plugins: [
// Write the types to our dist directory
typescript({ tsconfig: "./tsconfig.lib.json" }),
],
},
},
});