-
Notifications
You must be signed in to change notification settings - Fork 6
/
vite.config.ts
39 lines (37 loc) · 1.08 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
import { defineConfig, ViteDevServer } from "vite";
import react from "@vitejs/plugin-react";
import dsv from "@rollup/plugin-dsv";
import { resolve } from 'path';
import analyze from 'rollup-plugin-analyzer'
// The Vite Chokidar overrides don't actually work unless you write a plugin.
// This plugin overwrites the `ignored` directories for live-reloading. We do
// this to avoid reloads on changes to `sample-data/`.
//
// https://github.com/vitejs/vite/issues/8341
const ignored = () => {
return {
name: "ignored-overrides",
configureServer: (server: ViteDevServer): void => {
server.watcher.options = {
...server.watcher.options,
ignored: ["**/.git/**", "**/node_modules/**", "**/sample-data/**"],
};
},
};
};
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), dsv(), ignored(), {...analyze(), apply: "build"}],
base: '',
server: {
host: true
},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
embedded: resolve(__dirname, "embedded.html")
}
}
}
});