-
Notifications
You must be signed in to change notification settings - Fork 0
/
edp-build-config.js
67 lines (61 loc) · 1.59 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
exports.input = __dirname;
var path = require( 'path' );
exports.output = path.resolve( __dirname, 'output' );
var moduleEntries = 'html,htm,phtml,tpl,vm,js';
var pageEntries = 'html,htm,phtml,tpl,vm';
exports.getProcessors = function () {
return [
new LessCompiler( {
entryExtnames: pageEntries
} ),
new CssCompressor(),
new ModuleCompiler( {
configFile: 'module.conf',
entryExtnames: moduleEntries
} ),
new JsCompressor(),
new PathMapper( {
replacements: [
{ type: 'html', tag: 'link', attribute: 'href', extnames: pageEntries },
{ type: 'html', tag: 'img', attribute: 'src', extnames: pageEntries },
{ type: 'html', tag: 'script', attribute: 'src', extnames: pageEntries },
{ extnames: moduleEntries, replacer: 'module-config' }
],
from: 'src',
to: './'
} )
];
};
exports.exclude = [
'/tool',
'/doc',
'/test',
'/module.conf',
'/dep/packages.manifest',
'/dep/*/*/test',
'/dep/*/*/doc',
'/dep/*/*/demo',
'/dep/*/*/tool',
'/dep/*/*/*.md',
'/dep/*/*/package.json',
'/edp-*',
'/.edpproj',
'.svn',
'.git',
'.gitignore',
'.idea',
'.project',
'Desktop.ini',
'Thumbs.db',
'.DS_Store',
'*.tmp',
'*.bak',
'*.swp',
/* 用户自定义忽略文件 */
'README.md'
];
exports.injectProcessor = function ( processors ) {
for ( var key in processors ) {
global[ key ] = processors[ key ];
}
};