Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
9d5d8be4
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9d5d8be4
编写于
10月 31, 2017
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tweak build.
上级
e4a010e6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
157 addition
and
61 deletion
+157
-61
.jshintrc
.jshintrc
+1
-0
build/.jshintrc
build/.jshintrc
+76
-0
build/build.js
build/build.js
+16
-13
build/config.js
build/config.js
+21
-8
build/helper.js
build/helper.js
+43
-40
未找到文件。
.jshintrc
浏览文件 @
9d5d8be4
...
...
@@ -26,6 +26,7 @@
"debug": false,
"eqnull": true,
"esversion": 6,
"module": true,
"evil": true,
"expr": true,
"funcscope": false,
...
...
build/.jshintrc
0 → 100644
浏览文件 @
9d5d8be4
{
"bitwise": false,
"camelcase": true,
"curly": true,
"eqeqeq": false,
"forin": false,
"immed": true,
"latedef": false,
"newcap": true,
"noarg": false,
"noempty": true,
"nonew": true,
"plusplus": false,
"quotmark": "single",
"regexp": false,
"undef": true,
"unused": "vars",
"strict": false,
"trailing": false,
"maxparams": 20,
"maxdepth": 6,
"maxlen": 200,
"asi": false,
"boss": false,
"debug": false,
"eqnull": true,
"esversion": 6,
"evil": true,
"expr": true,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": true,
"laxcomma": false,
"loopfunc": false,
"multistr": false,
"onecase": false,
"proto": false,
"regexdash": false,
"scripturl": false,
"smarttabs": false,
"shadow": true,
"sub": true,
"supernew": false,
"validthis": true,
"browser": true,
"couch": false,
"devel": true,
"dojo": false,
"jquery": true,
"mootools": false,
"node": false,
"nonstandard": false,
"prototypejs": false,
"rhino": false,
"wsh": false,
"nomen": false,
"onevar": false,
"passfail": false,
"white": false,
"varstmt": true,
"predef": [
"__DEV__",
"global",
"require",
"exports",
"Buffer",
"__dirname"
]
}
\ No newline at end of file
build/build.js
浏览文件 @
9d5d8be4
#!/usr/bin/env node
le
t
fsExtra
=
require
(
'
fs-extra
'
);
le
t
{
resolve
}
=
require
(
'
path
'
);
le
t
config
=
require
(
'
./config.js
'
);
le
t
commander
=
require
(
'
commander
'
);
le
t
{
build
,
watch
}
=
require
(
'
./helper
'
);
cons
t
fsExtra
=
require
(
'
fs-extra
'
);
cons
t
{
resolve
}
=
require
(
'
path
'
);
cons
t
config
=
require
(
'
./config.js
'
);
cons
t
commander
=
require
(
'
commander
'
);
cons
t
{
build
,
watch
}
=
require
(
'
./helper
'
);
function
run
()
{
...
...
@@ -60,11 +60,11 @@ function run() {
let
configs
=
[];
if
(
isWatch
)
{
watch
(
config
.
createECharts
Build
(
opt
));
watch
(
config
.
createECharts
(
opt
));
}
else
{
if
(
!
buildAll
)
{
configs
=
[
config
.
createECharts
Build
(
opt
)];
configs
=
[
config
.
createECharts
(
opt
)];
}
else
{
configs
=
[];
...
...
@@ -76,15 +76,15 @@ function run() {
{
min
:
true
,
lang
:
'
en
'
}
].
forEach
(
function
(
opt
)
{
[
''
,
'
simple
'
,
'
common
'
].
forEach
(
function
(
type
)
{
configs
.
push
(
config
.
createECharts
Build
(
Object
.
assign
({
type
},
opt
)));
configs
.
push
(
config
.
createECharts
(
Object
.
assign
({
type
},
opt
)));
});
});
configs
.
push
(
config
.
createBMap
Build
(
false
),
config
.
createBMap
Build
(
true
),
config
.
createDataTool
Build
(
false
),
config
.
createDataTool
Build
(
true
)
config
.
createBMap
(
false
),
config
.
createBMap
(
true
),
config
.
createDataTool
(
false
),
config
.
createDataTool
(
true
)
);
}
...
...
@@ -96,7 +96,10 @@ function run() {
}
}
// Based on echarts dir/
/**
* @param {string} relativePath Based on echarts directory.
* @return {string} Absolute path.
*/
function
getPath
(
relativePath
)
{
return
resolve
(
__dirname
,
'
../
'
,
relativePath
);
}
...
...
build/config.js
浏览文件 @
9d5d8be4
/* global require, __dirname, exports */
let
nodeResolvePlugin
=
require
(
'
rollup-plugin-node-resolve
'
);
let
uglifyPlugin
=
require
(
'
rollup-plugin-uglify
'
);
let
{
dirname
,
resolve
}
=
require
(
'
path
'
);
const
nodeResolvePlugin
=
require
(
'
rollup-plugin-node-resolve
'
);
const
uglifyPlugin
=
require
(
'
rollup-plugin-uglify
'
);
const
{
dirname
,
resolve
}
=
require
(
'
path
'
);
// Based on echarts/
function
getPath
(
relativePath
)
{
...
...
@@ -49,7 +47,7 @@ function getPlugins(min, lang) {
* @param {boolean} [opt.min=false]
* @param {string} [opt.lang=undefined] null/undefined/'' or 'en' or 'fi' or ...
*/
exports
.
createECharts
Build
=
function
(
opt
)
{
exports
.
createECharts
=
function
(
opt
)
{
opt
=
opt
||
{};
let
postfixType
=
opt
.
type
?
'
.
'
+
opt
.
type
:
''
;
let
postfixMin
=
opt
.
min
?
'
.min
'
:
''
;
...
...
@@ -74,7 +72,7 @@ exports.createEChartsBuild = function (opt) {
/**
* @param {boolean} [min=false]
*/
exports
.
createBMap
Build
=
function
(
min
)
{
exports
.
createBMap
=
function
(
min
)
{
let
postfix
=
min
?
'
.min
'
:
''
;
return
{
...
...
@@ -101,7 +99,7 @@ exports.createBMapBuild = function (min) {
/**
* @param {boolean} [min=false]
*/
exports
.
createDataTool
Build
=
function
(
min
)
{
exports
.
createDataTool
=
function
(
min
)
{
let
postfix
=
min
?
'
.min
'
:
''
;
return
{
plugins
:
getPlugins
(
min
),
...
...
@@ -123,3 +121,18 @@ exports.createDataToolBuild = function (min) {
}
};
};
/**
* @param {string} [absolutePath]
*/
exports
.
createSingleModule
=
function
(
absolutePath
)
{
return
{
plugins
:
getPlugins
(),
input
:
absolutePath
,
legacy
:
true
,
// Support IE8-
output
:
{
name
:
'
echarts
'
,
format
:
'
amd
'
}
};
};
build/helper.js
浏览文件 @
9d5d8be4
/* global require, exports */
let
rollup
=
require
(
'
rollup
'
);
const
rollup
=
require
(
'
rollup
'
);
/**
* @param {Array.<Object>} configs A list of rollup configs:
...
...
@@ -14,45 +12,50 @@ let rollup = require('rollup');
* },
* ...
* ]
* @return {Promise}
*/
exports
.
build
=
function
(
configs
)
{
let
index
=
0
;
return
new
Promise
(
function
(
promiseResolve
,
promiseReject
)
{
let
index
=
0
;
buildSingle
();
buildSingle
();
function
buildSingle
()
{
let
singleConfig
=
configs
[
index
++
];
function
buildSingle
()
{
let
singleConfig
=
configs
[
index
++
];
if
(
!
singleConfig
)
{
return
;
}
if
(
!
singleConfig
)
{
promiseResolve
();
return
;
}
console
.
log
(
color
(
'
fgCyan
'
,
'
dim
'
)(
'
\n
Bundles
'
),
color
(
'
fgCyan
'
)(
singleConfig
.
input
),
color
(
'
fgCyan
'
,
'
dim
'
)(
'
=>
'
),
color
(
'
fgCyan
'
)(
singleConfig
.
output
.
file
),
color
(
'
fgCyan
'
,
'
dim
'
)(
'
...
'
)
);
console
.
log
(
color
(
'
fgCyan
'
,
'
dim
'
)(
'
\n
Bundles
'
),
color
(
'
fgCyan
'
)(
singleConfig
.
input
),
color
(
'
fgCyan
'
,
'
dim
'
)(
'
=>
'
),
color
(
'
fgCyan
'
)(
singleConfig
.
output
.
file
),
color
(
'
fgCyan
'
,
'
dim
'
)(
'
...
'
)
);
rollup
.
rollup
(
singleConfig
)
.
then
(
function
(
bundle
)
{
return
bundle
.
write
(
singleConfig
.
output
);
})
.
then
(
function
()
{
console
.
log
(
color
(
'
fgGreen
'
,
'
dim
'
)(
'
Created
'
),
color
(
'
fgGreen
'
)(
singleConfig
.
output
.
file
),
color
(
'
fgGreen
'
,
'
dim
'
)(
'
successfully.
'
)
);
buildSingle
();
})
.
catch
(
function
(
err
)
{
console
.
log
(
color
(
'
fgRed
'
)(
err
));
});
}
}
rollup
.
rollup
(
singleConfig
)
.
then
(
function
(
bundle
)
{
return
bundle
.
write
(
singleConfig
.
output
);
})
.
then
(
function
()
{
console
.
log
(
color
(
'
fgGreen
'
,
'
dim
'
)(
'
Created
'
),
color
(
'
fgGreen
'
)(
singleConfig
.
output
.
file
),
color
(
'
fgGreen
'
,
'
dim
'
)(
'
successfully.
'
)
);
buildSingle
();
})
.
catch
(
function
(
err
)
{
console
.
log
(
color
(
'
fgRed
'
)(
err
));
promiseReject
();
});
}
});
};
/**
* @param {Object} singleConfig A single rollup config:
...
...
@@ -65,7 +68,7 @@ exports.build = function (configs) {
* }
*/
exports
.
watch
=
function
(
singleConfig
)
{
var
watcher
=
rollup
.
watch
(
singleConfig
);
let
watcher
=
rollup
.
watch
(
singleConfig
);
watcher
.
on
(
'
event
'
,
function
(
event
)
{
// event.code can be one of:
...
...
@@ -89,7 +92,7 @@ exports.watch = function (singleConfig) {
printWatchResult
(
event
);
}
});
}
}
;
function
printWatchResult
(
event
)
{
console
.
log
(
...
...
@@ -155,12 +158,12 @@ const COLOR_MAP = {
* Print colored text with `console.log`.
*
* Usage:
*
var
color = require('colorConsole');
*
let
color = require('colorConsole');
* color('fgCyan')('some text'); // cyan text.
* color('fgCyan', 'bright')('some text'); // bright cyan text.
* color('fgCyan', 'bgRed')('some text') // cyan text and red background.
*/
function
color
()
{
let
color
=
exports
.
color
=
function
()
{
let
prefix
=
[];
for
(
let
i
=
0
;
i
<
arguments
.
length
;
i
++
)
{
let
color
=
COLOR_MAP
[
arguments
[
i
]];
...
...
@@ -171,4 +174,4 @@ function color() {
return
function
(
text
)
{
return
prefix
+
text
+
COLOR_RESET
;
};
}
}
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录