-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
39 lines (36 loc) · 872 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
34
35
36
37
38
import { defineConfig } from "vite"
import path from "path"
import dts from "vite-plugin-dts"
import VitePluginCleaned from "./src/index"
import { nodePolyfills } from "vite-plugin-node-polyfills"
export default defineConfig({
plugins: [
VitePluginCleaned({
folder: ["dist", "dist-types"],
}),
dts({
entryRoot: "src",
outputDir: "dist",
tsConfigFilePath: "./tsconfig.json",
}),
nodePolyfills(),
],
build: {
lib: {
entry: path.resolve(__dirname, "src/index.ts"),
name: "VitePluginCleaned",
fileName: format => `vite-plugin-cleaned.${format}.js`,
},
rollupOptions: {
external: ["fs-extra", "ora", "chalk"],
output: {
globals: {
"fs-extra": "fs-extra",
ora: "ora",
chalk: "chalk",
},
exports: "named",
},
},
},
})