-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
49 lines (47 loc) · 1.26 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
/// <reference types="vite/client" />
/// <reference types="vitest" />
import { resolve } from "path";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import svgr from "vite-plugin-svgr";
import { configDefaults } from "vitest/config";
// https://vitejs.dev/config/
export default defineConfig(() => ({
plugins: [
svgr(),
react(),
dts({ rollupTypes: true }),
],
build: {
lib: {
entry: resolve(__dirname, "src/index.ts"),
name: "@reearth/core",
},
rollupOptions: {
external: ["react", "react-dom", "cesium"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
cesium: "Cesium",
},
},
},
},
resolve: {
alias: [{ find: "csv-parse", replacement: "csv-parse/browser/esm" }],
},
test: {
environment: "jsdom",
setupFiles: ["src/test/setup.ts"],
exclude: [...configDefaults.exclude, "e2e/*"],
coverage: {
all: true,
include: ["src/**/*.ts", "src/**/*.tsx"],
exclude: ["src/**/*.d.ts", "src/**/*.cy.tsx", "src/**/*.stories.tsx", "src/test/**/*"],
reporter: ["text", "json", "lcov"],
},
alias: [{ find: "csv-parse", replacement: "csv-parse" }],
},
}));