forked from dailc/hybrid-h5plus-rayapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
120 lines (120 loc) · 2.81 KB
/
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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/**
* 作者: dailc
* 时间: 2016-06-22
* 描述: gulp的一些配置,包括路径,项目层级
*
*/
(function() {
//项目path,默认为''代表不使用项目path
//示例/testproject
//var projectPath = '/testDemo'
var projectPath = '/showcase.dcloud.rayapp'
var src = './src' + projectPath;
var dest = './build' + projectPath;
var rev = './rev' + projectPath;
var isMiniJs = false;
//定义的一些文件编译和输出路径,可以不用管太多
module.exports = {
//如果src前有**,目录会自动补齐
src:src,
dest:dest,
rev:rev,
css: {
//所有需要编译的css
src: src + '/**/css/**/*.css',
//输出目录
dest: dest + "",
//json目录
revJson: rev + "/rev-manifest-css.json"
},
js: {
src: src + '/js/**/*.js',
coreJs: {
src: src + '/**/js/core/**/*.js',
dest: dest + "",
revJson: rev + "/rev-manifest-coreJs.json"
},
bizlogicJs: {
src: src + '/**/js/bizlogic/**/*.js',
dest: dest + "",
revJson: rev + "/rev-manifest-bizlogicJs.json"
},
//seaConfig-以下三个config会合并
seaConfigJs: {
src: src + '/**/sea.config.js',
dest: dest + "",
revJson: rev + "/rev-manifest-config.json"
},
//业务处理的config ->包括自定义sea别名等
bizConfigJs: {
src: src + '/**/bizlogic/config/seaBizConfig.js',
dest: dest + "",
revJson: rev + "/rev-manifest-config.json"
},
//cacheController->控制引入seaConfig
cacheConfigJs: {
src: src + '/**/cacheControl.config.js',
dest: dest + "",
revJson: rev + "/rev-manifest-config.json"
}
},
//默认图片只处理img目录下的,其它目录下的由于路径问题不好替换
//所以img文件夹下请别放其它文件
//由于有些项目直接在html里又有img,所以构建时得单独排除那一部分
img: {
jpg: {
src: src + '/img/**/*.jpg'
},
png: {
src: src + '/img/**/*.png'
},
gif: {
src: src + '/img/**/*.gif'
},
src: src + '/**/img/**/*',
dest: dest + "",
revJson: rev + "/rev-manifest-img.json"
},
//只处理json文件夹下面的json
json: {
src: src + '/**/json/**/*.json',
dest: dest + "",
revJson: rev + "/rev-manifest-json.json"
},
clean: {
src: dest
},
html: {
img: {
src: src + '/html/**/img/**/*',
dest: dest + "/html"
},
src: src + "/**/*.html",
dest: dest + ""
},
//引用,构建图片时需要过滤掉libs下引用的图片
libs: {
img: {
src: src + '/libs/**/img/**/*',
dest: dest + "/libs"
}
},
other: {
project: {
src: src + "/**/.project",
},
svn: {
src: src + "/**/.svn/*",
},
settings: {
src: src + "/**/.settings/*",
},
src: src + "/**/*",
dest: dest + ""
},
rev: { //use rev to reset html resource url
revJson: rev + "/**/*.json"
},
isMiniJs:isMiniJs
};
})();