generated from theholocron/base-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
35 lines (34 loc) · 873 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
import * as path from "node:path";
import { defineConfig } from "vite";
/*
* @see https://vitejs.dev/config/
*/
export default defineConfig({
plugins: [],
build: {
lib: {
entry: path.resolve(__dirname, "src/index.ts"), // Entry point of your library
name: "node-template",
formats: ["es", "cjs"], // Specify formats (ESM and CommonJS)
fileName: (format) => `node-template.${format}.js`,
},
rollupOptions: {
external: [], // Externalize any specific Node dependencies
output: {
globals: {
// Define globals for any externalized dependencies
},
},
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"), // Adjust as needed
},
},
test: {
globals: true,
environment: "node", // Use Node environment for testing
setupFiles: "./test.setup.ts", // Optional setup file for additional configurations
},
});