forked from zxeryu/vue-start
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.config.js
61 lines (61 loc) · 1.59 KB
/
start.config.js
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
module.exports = {
route: {
fileType: ".ts",
options: {
//屏蔽的文件夹名称
ignoreDirs: ["component", "components", "demo", "demo-vue"],
//屏蔽的文件名称
ignoreFiles: ["component", "components", "config-extra"],
//查找的文件后缀类型
fileTypes: [".ts", ".tsx", ".vue"],
//前缀
importPrefix: "@/views",
},
list: [
{
name: "routes",
path: ["src", "views"], //文件夹路径
generatePath: ["src", "router"], //生成文件路径
// routeNames: true, //生成名字
convertData: (routeResult) => {
//转换数据
return {
...routeResult,
routeStr: routeResult.routeStr.replace(/.tsx/g, ""),
};
},
},
{
name: "modules",
path: ["src", "pro", "module"],
//options 拓展 自定义
options: {
importPrefix: "@/pro/module", //前缀
simpleLeaf: true, //去除仅有一个叶子节点的数据
},
generatePath: ["src", "router"], //生成文件路径
routeNames: true, //生成名字文件
convertData: (routeResult) => {
//转换数据
return {
...routeResult,
routeStr: routeResult.routeStr.replace(/.ts/g, ""),
};
},
},
],
},
client: {
fileType: ".ts",
list: [
{
name: "iam",
// url: "",
basePath: "",
// ignorePaths: [],
// selectPaths: [],
generatePath: ["src", "clients"],
},
],
},
};