-
Notifications
You must be signed in to change notification settings - Fork 173
/
vite.config.ts
44 lines (42 loc) · 993 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
36
37
38
39
40
41
42
43
44
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import { resolve } from 'path';
//直接获取文件的text
function rawTransform(
fileRegex: Array<RegExp>,
): {
name: string;
transform: (src: string, id: string) => string | void;
} {
return {
name: 'get-file-raw',
transform(src, id): string | void {
if (fileRegex.filter((re) => re.test(id)).length > 0) {
return `export default ${JSON.stringify(src)}`;
}
},
};
}
export default {
base: './',
optimizeDeps: {
//声明深度路径模块
include: [
'bpmn-js/lib/Modeler',
'highlight.js',
'codemirror',
'codemirror/mode/xml/xml.js',
'codemirror/addon/hint/xml-hint.js',
'bpmn-js/lib/features/label-editing/LabelUtil.js',
],
},
plugins: [vue(), rawTransform([/\.bpmn$/]), vueJsx()],
resolve: {
alias: [
{
find: '@',
replacement: resolve(__dirname, './src'),
},
],
},
};