-
-
Notifications
You must be signed in to change notification settings - Fork 155
/
vite.config.mts
42 lines (37 loc) · 1.05 KB
/
vite.config.mts
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
import path from 'node:path'
import { dirname } from 'path'
import { fileURLToPath } from 'url'
import vscode from '@tomjs/vite-plugin-vscode'
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
import pkg from './package.json'
const dir =
typeof __dirname === 'string'
? __dirname
: dirname(fileURLToPath(import.meta.url))
const resolvePath = (...paths: string[]) => path.resolve(dir, ...paths)
// https://vitejs.dev/config/
export default defineConfig(() => {
process.env.APP_BUILD_TIME = `${Date.now()}`
process.env.APP_VERSION = pkg.version
return {
plugins: [
tsconfigPaths(),
react(),
vscode({
extension: {
entry: resolvePath('./src/extension/index.ts'),
platform: 'node',
target: 'node18',
sourcemap: true,
skipNodeModulesBundle: false
// treeshake: {
// preset: 'smallest',
// moduleSideEffects: 'no-external'
// }
}
})
]
}
})