forked from fex-team/fis-pure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pure.js
98 lines (96 loc) · 2.65 KB
/
pure.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
var fis = module.exports = require('fis');
fis.cli.name = 'fis-pure';
fis.cli.info = fis.util.readJSON(__dirname + '/package.json');
fis.config.merge({
statics: '/static',
modules: {
parser: {
less: 'less',
tmpl: 'utc'
},
postprocessor: {
js: "jswrapper, require-async",
html: "require-async"
},
postpackager: ['autoload', 'simple'],
lint: {
js: 'jshint'
}
},
roadmap: {
ext: {
less: 'css'
},
path: [{
reg: /^\/components\/.*\.js$/i,
isMod: true
}, {
reg: /^\/page\/(.*)$/i,
useCache: false,
release: '$1'
}, {
//一级同名组件,可以引用短路径,比如modules/jquery/juqery.js
//直接引用为var $ = require('jquery');
reg: /^\/modules\/([^\/]+)\/\1\.(js)$/i,
//是组件化的,会被jswrapper包装
isMod: true,
//id为文件夹名
id: '$1',
release: '${statics}/$&'
}, {
//modules目录下的其他脚本文件
reg: /^\/modules\/(.*)\.(js)$/i,
//是组件化的,会被jswrapper包装
isMod: true,
//id是去掉modules和.js后缀中间的部分
id: '$1',
release: '${statics}/$&'
}, {
//less的mixin文件无需发布
reg: /^(.*)mixin\.less$/i,
release: false
}, {
//其他css文件
reg: /^(.*)\.(css|less)$/i,
release: '${statics}/$&'
}, {
//前端模板
reg: '**.tmpl',
//当做类js文件处理,可以识别__inline, __uri等资源定位标识
isJsLike: true,
//只是内嵌,不用发布
release: false
}, {
reg: /.*\.(html|jsp|tpl|vm|htm|asp|aspx|php)$/,
useCache: false,
release: '$&'
}, {
reg: "README.md",
release: false
}, {
reg: "**",
release: '${statics}/$&'
}]
},
settings: {
postprocessor: {
jswrapper: {
type: 'amd'
}
},
lint: {
jshint: {
camelcase: true,
curly: true,
eqeqeq: true,
forin: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
noempty: true,
node: true
}
}
}
});