-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
64 lines (62 loc) · 1.65 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/// <reference types="vitest" />
/// <reference types="vite-plugin-svgr/client" />
import svgr from "@svgr/rollup";
import react from "@vitejs/plugin-react-swc";
import { resolve } from "path";
import nodeExternals from "rollup-plugin-node-externals";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
dts({
rollupTypes: true,
// config relating to api-extractor, which rolls up the types
rollupConfig: {
messages: {
extractorMessageReporting: {
"ae-forgotten-export": {
// @ts-expect-error - this is a valid config
logLevel: "warning",
},
},
},
},
}),
{ ...nodeExternals(), enforce: "pre" },
],
build: {
target: "esnext",
minify: false,
copyPublicDir: false,
lib: {
entry: resolve(__dirname, "lib/index.ts"),
name: "megamenu",
fileName: "index",
formats: ["es", "cjs", "umd"],
},
rollupOptions: {
plugins: [svgr()],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
"@headlessui/react": "HeadlessUI",
clsx: "clsx",
"react-device-detect": "react-dd",
"react-hotkeys-hook": "ReactHotkeysHook",
"tailwind-merge": "twmerge",
},
},
},
},
test: {
globals: true,
environment: "jsdom",
setupFiles: resolve(__dirname, "scripts/tests/setup.js"),
// you might want to disable it, if you don't have tests that rely on CSS
// since parsing CSS is slow
css: true,
},
});