-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
executable file
·120 lines (96 loc) · 3.25 KB
/
index.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
var fis = module.exports = require('fis3');
var pkg = require('./package');
var webapp = require('./lib/config/webapp');
var webpage = require('./lib/config/webpage');
var simple = require('./lib/config/simple');
var component = require('./lib/config/component');
fis.require.prefixes.unshift(pkg.name);
fis.cli.name = pkg.name;
fis.cli.info = pkg;
fis.cli.version = require('./lib/version');
// 全局配置 http://fis.baidu.com/fis3/docs/api/config-props.html
fis.config.merge({
// 脚手架配置
// fis-components/jquery@latest
// fis-component/jquery@1.9.1
// efit init <github username>/<github project>@<version>
// efit init [efitjs/]<name>@<version>
scaffold: {
// 默认仓库类型 github
type: 'github',
// 脚手架仓库名称 https://github.com/efitjs
namespace: 'efitjs'
},
// 项目配置
project: {
// 项目名称
name: '',
// 项目版本号,填了后自动替换源码中@VERSION@标识,不填则由ci-shell来替换,没有CI环境时必须设置
version: '',
// 静态资源部署目录
statics: '/asset',
// 业务入口, 入口的设置方式决定了打包的方式
// entry(直接设置文件入口路径): '/app/m/index.js' => /asset/pkg/app.js /asset/pkg/app.css
// entry(设置app/单业务入口标识)-推荐: ['m'] => /asset/pkg/lib.js /asset/pkg/lib.css /asset/pkg/app.js /asset/pkg/app.css
// entry(设置app/多业务入口标识)-推荐: ['marketing', 'platform'] /asset/pkg/lib.js /asset/pkg/lib.css /asset/pkg/common.js /asset/pkg/common.css /asset/pkg/{entry}.js /asset/pkg/{entry}.css
entry: [],
// 项目调试的服务环境:(local|dev|sit|uat|prd),填了后自动替换源码中@ENV@标识,不填则不替换
debugENV: '',
// 是否在调试模式下(非media)合并后开启 SourceMap 功能,启用后watch状态要3s+生效,相对比较慢,但方便调试
useSourceMap: false,
// eslint配置文件 http://eslint.org/
eslintrc: {},
// stylelint配置文件 https://stylelint.io/
stylelintrc: {},
charset: 'utf8',
// 文件MD5戳长度
md5Length: 7,
md5Connector: '.',
// 设置项目源码文件过滤器
files: ['**'],
// 排除某些文件
ignore: ['node_modules/**', 'output/**', '.git/**', 'fis-conf.js']
},
// 服务环境配置
environment: {
// 开发环境
development: {
// 静态资源的域名
domain: '',
// 是否优化
optimizer: true,
// 是否打包
packager: true
},
// 测试环境
testing: {
// 静态资源的域名
domain: '',
// 是否优化
optimizer: true,
// 是否打包
packager: true
},
// 生产环境
production: {
// 静态资源的域名
domain: '',
// 是否优化
optimizer: true,
// 是否打包
packager: true
}
}
});
// simple 配置模式
fis.simple = simple;
// webpage 配置模式
fis.webpage = webpage;
// webapp 配置模式
fis.webapp = webapp;
// component 配置模式
fis.component = component;
// register command plugins
// [].forEach(function (name) {
// fis.require._cache['command-' + name] = require('./lib/command/' + name);
// });