-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfis-conf.js
95 lines (78 loc) · 2.14 KB
/
fis-conf.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//打包配置
fis.match('::package', { //打包载入资源配置
postpackager: fis.plugin('loader', {
resourceType: 'amd',
useInlineMap: true, // 资源映射表内嵌
processor: { //预处理jade文件当成是Html页面,在进行一些插件使用时,有必要配置这个参数,比如sass的编译后合并打包处理
".jade": "html",
".html": "html"
}
}),
spriter: fis.plugin("csssprites", {
//使用矩阵排列方式,默认为线性`linear`
layout: 'matrix',
scale: 1,
margin: 10
}) //打包阶段设置合并雪碧图
});
fis.hook("amd");
fis.match("**.json", {
release: false
});
fis.match("**.css", {
//useHash: true
});
fis.match("index.jade", {
parser: fis.plugin("jade"),
rExt: ".html"
});
//js文件处理
fis
.match(/^components\/(.*\/)*(.*)\.js$/, {
isMod: true
})
.match(/^\/(pages|widgets|plugin)\/(.*\/)*(.*)\.js$/, {
isMod: true,
release: "module/$2/$3"
});
//pages 页面处理
fis
.match(/^\/pages\/(.*)\/(.*)\.jade$/, {
parser: fis.plugin("jade"),
rExt: ".html",
release: "pages/$1/$2"
})
.match(/^\/pages\/(.*)\/(.*)\.(scss|css)/, {
parser: fis.plugin("node-sass"),
rExt: ".css",
packTo: "static/css/page.css"
})
.match("pages/**.{jpg,png}", {
release: "static/img/$0"
});
//plugin 插件处理
fis
.match(/^\/plugin\/(.\/)*(.*)\.jade$/, {
parser: fis.plugin("jade"),
rExt: ".html"
})
.match(/^\/plugin\/(.\/)*(.*)\.(scss|css)$/, {
parser: fis.plugin("node-sass"),
rExt: ".css",
packTo: "static/css/plugin.css"
});
//widgets 组件页面处理
fis
.match(/^\/widgets\/(.\/)*(.*)\.jade$/, {
parser: fis.plugin("jade"),
rExt: ".html",
release: false
})
.match(/^\/widgets\/(.\/)*(.*)\.(scss|css)$/, {
parser: fis.plugin("node-sass"),
rExt: ".css",
packTo: "static/css/widgets.css"
})
.match(/^\/widgets\/(.*\/)*(.*)\.(jpg|png)$/, {
release: "static/img/$2"
});