-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
42 lines (41 loc) · 1.38 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
import * as path from "path";
import { PluginOption, defineConfig } from "vite";
import dts from "vite-plugin-dts";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
import rollupNodePolyFill from "rollup-plugin-node-polyfills";
export default defineConfig({
resolve: {
alias: {
process: "rollup-plugin-node-polyfills/polyfills/process-es6",
util: "rollup-plugin-node-polyfills/polyfills/util",
buffer: "rollup-plugin-node-polyfills/polyfills/buffer-es6",
stream: "vite-compatible-readable-stream",
_stream_duplex: "vite-compatible-readable-stream/lib/_stream_uplex",
_stream_passthrough:
"vite-compatible-readable-stream/lib/_stream_passthrough",
_stream_readable: "vite-compatible-readable-stream/lib/_stream_readable",
_stream_writable: "vite-compatible-readable-stream/lib/_stream_writable",
_stream_transform:
"vite-compatible-readable-stream/lib/_stream_transform",
},
},
plugins: [
peerDepsExternal({ includeDependencies: true }) as PluginOption,
dts({
insertTypesEntry: true,
}),
],
build: {
emptyOutDir: true,
sourcemap: true,
lib: {
entry: path.resolve(__dirname, "src/index.ts"),
name: "ooui",
formats: ["es"],
fileName: (format) => `ooui.${format}.js`,
},
rollupOptions: {
plugins: [rollupNodePolyFill() as any],
},
},
});