-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathvite.config.js
More file actions
50 lines (46 loc) · 1.2 KB
/
Copy pathvite.config.js
File metadata and controls
50 lines (46 loc) · 1.2 KB
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
/// <reference types="vitest" />
import atomico from "@atomico/vite";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import { appendFile, readFile } from "fs/promises";
import { playwright } from "@vitest/browser-playwright";
const fileName = "cally";
export default defineConfig({
build: {
target: "esnext",
lib: {
entry: ["src/index.ts"],
formats: ["es"],
fileName,
},
minify: true,
},
plugins: [
...atomico({
cssLiterals: { postcss: true, minify: true },
}),
dts({
rollupTypes: true,
bundledPackages: ["atomico"],
tsconfigPath: "./tsconfig.build.json",
// workaround to include the global types
async afterBuild() {
const globals = await readFile("./src/globals.d.ts");
await appendFile(`./dist/${fileName}.d.ts`, globals);
},
}),
],
optimizeDeps: {
include: ["atomico/jsx-dev-runtime"],
},
test: {
setupFiles: ["./vitest.setup.ts"],
browser: {
enabled: true,
provider: playwright(),
instances: [{ browser: "chromium" }],
headless: true,
screenshotFailures: false,
},
},
});