-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
64 lines (62 loc) · 1.74 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* @Author: cumany [email protected]
* @Date: 2023-09-06 15:09:17
* @LastEditors: cumany [email protected]
* @LastEditTime: 2024-03-25 13:14:43
* @Description:
*/
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import replace from '@rollup/plugin-replace'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.less', '.css'],
alias: {
'@': path.resolve(__dirname, './src'),
}
},
build: {
minify: true,
lib: {
entry: './src/main.ts',
name: 'main',
formats: ['cjs']
},
emptyOutDir: false,
target: 'esNext',
rollupOptions: {
external: [
"obsidian",
"electron",
"@codemirror/autocomplete",
"@codemirror/collab",
"@codemirror/commands",
"@codemirror/language",
"@codemirror/lint",
"@codemirror/search",
"@codemirror/state",
"@codemirror/view",
"@lezer/common",
"@lezer/highlight",
"@lezer/lr"
],
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
preventAssignment: true
})
],
output: {
entryFileNames: "main.js",
assetFileNames: "styles.css",
dir: ".",
sourcemap: "inline",
format: "cjs",
exports: "default"
}
}
}
})