-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfis-conf.js
96 lines (90 loc) · 1.98 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
95
// default settings. fis3 release
// Global start
fis.hook('commonjs');
fis.match('::package', {
postpackager: fis.plugin('loader', {})
})
.match('*.html', {
optimizer: fis.plugin('html-minifier')
})
.match('::image', {
useHash: true
})
.match('*.png', {
// fis-optimizer-png-compressor 插件进行压缩,已内置
optimizer: fis.plugin('png-compressor', {
type: 'pngquant' //default is pngcrush
})
})
.match('/static/gut.gif', {
useHash: false
})
.match('*.ico', {
useHash: false
})
.match('/widget/**.js', {
isMod: true,
useHash: false
})
.match('*.less', {
parser: fis.plugin('less-2.x'),
rExt: '.css'
});
// Global end
// default media `dev`:本地环境
fis.media('dev')
.match('*', {
useHash: false,
optimizer: null
});
// media `test/prod_*`:发布到测试(test)或线上环境(prod_*)
const SERVERS = [{
media: 'test',
ip: '10.45.10.72'
}, {
media: 'prod_1',
ip: '10.8.23.151', // '10.9.17.145'
}, {
media: 'prod_2',
ip: '10.8.23.152', // '10.9.17.146'
}];
SERVERS.map(function(v) {
fis.media(v.media)
.match('/{pkg,static,page}/**', {
deploy: fis.plugin('http-push', {
receiver: 'http://' + v.ip + ':8999/receiver',
//远端目录
to: '/home/appadmin/best123/source'
})
})
.match('/widget/**/img/**', {
deploy: fis.plugin('http-push', {
receiver: 'http://' + v.ip + ':8999/receiver',
//远端目录
to: '/home/appadmin/best123/source'
})
})
.match('/favicon.ico', {
deploy: fis.plugin('http-push', {
receiver: 'http://' + v.ip + ':8999/receiver',
//远端目录
to: '/home/appadmin/best123/source'
})
})
.match('/widget/**.js', {
optimizer: fis.plugin('uglify-js'),
exclude: '/widget/ui/**.js',
packTo: '/pkg/aio.js'
})
.match('/widget/ui/**.js', {
optimizer: fis.plugin('uglify-js'),
packTo: '/pkg/common.js'
})
.match('*.{less,css}', {
optimizer: fis.plugin('clean-css'),
packTo: '/pkg/aio.css'
})
.match('/pkg/*', {
useHash: true
});
});