-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.cli.mts
More file actions
47 lines (46 loc) · 1.16 KB
/
Copy pathvite.config.cli.mts
File metadata and controls
47 lines (46 loc) · 1.16 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
import { defineConfig } from 'vite';
import { resolve } from 'path';
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/cli/index.ts'),
formats: ['cjs'],
fileName: () => 'cli.js',
},
outDir: 'dist',
emptyOutDir: false,
rollupOptions: {
external: [
// Externalize Node builtins only — bundle everything else
/^node:/,
'fs',
'path',
'os',
'child_process',
'url',
'buffer',
'crypto',
'stream',
'events',
'util',
'http',
'https',
'net',
'tls',
'zlib',
// esbuild is a native binary — cannot be bundled.
// Resolved from the user's node_modules at runtime (Vite depends on it).
'esbuild',
// socket.io is used for WebSocket server in the local-server command.
// Must be external because it depends on engine.io/ws with native optional deps.
'socket.io',
],
output: {
banner: '#!/usr/bin/env node',
},
},
target: 'node18',
minify: false,
},
resolve: { alias: { src: resolve('src/') } },
});