forked from inkonchain/ink-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
33 lines (32 loc) · 841 Bytes
/
vite.config.ts
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
30
31
32
33
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import svgr from "vite-plugin-svgr";
import tailwindcss from "tailwindcss";
import { peerDependencies } from "./package.json";
export default defineConfig({
build: {
lib: {
entry: "./src/index.ts",
name: "vite-react-ts-button",
fileName: (format) => `index.${format}.js`,
formats: ["cjs", "es"],
},
rollupOptions: {
/** "react/jsx-runtime" is needed to support both React 18 and 19, plus it makes the bundle smaller */
external: ["react/jsx-runtime", ...Object.keys(peerDependencies)],
},
sourcemap: true,
emptyOutDir: true,
},
plugins: [
dts(),
svgr({
include: "**/*.svg?react",
}),
],
css: {
postcss: {
plugins: [tailwindcss("./tailwind.config.mjs")],
},
},
});