forked from ecomfe/fonteditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edp-build-config.js
92 lines (78 loc) · 1.9 KB
/
edp-build-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
var path = require( 'path' );
exports.input = __dirname;
exports.output = path.resolve(__dirname, './release');
exports.getProcessors = function () {
return [
new LessCompiler({
files: [
'css/main.less',
'css/preview.less'
],
entryFiles: []
}),
new Html2JsCompiler({
mode: 'default',
files: ['src/fonteditor/template/**/*.tpl'],
extnames: ['tpl'],
afterAll: function (context) {
this.processFiles.forEach(function (file) {
require('fs').writeFileSync(file.path + '.js', file.data);
});
}
}),
new ModuleCompiler( {
files: [
'src/fonteditor/main.js'
],
configFile: './module.conf'
}),
new JsCompressor({
files: [
'src/fonteditor/main.js',
'dep/**/*.js',
'!dep/**/*.min.js',
]
}),
// 清除冗余文件,比如`less`
new OutputCleaner({
files: [
'css/common/**',
'src/common/**',
'src/editor/**',
'src/graphics/**',
'src/math/**',
'src/render/**',
'src/fonteditor/*/**',
'dep/fonteditor-core/**',
'*.tpl'
]
})
];
};
exports.exclude = [
".svn",
"*.conf",
"*.sh",
"*.bat",
"*.md",
"demo",
"agent",
"mock",
"test",
"unittest",
"edp-*",
"output",
".DS_Store",
".gitignore",
".fecs*",
"package.json",
"node",
"node_modules",
"release",
"build"
];
exports.injectProcessor = function ( processors ) {
for ( var key in processors ) {
global[ key ] = processors[ key ];
}
};