Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
Chameleon
提交
d5e4449b
C
Chameleon
项目概览
DiDi
/
Chameleon
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Chameleon
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d5e4449b
编写于
4月 09, 2019
作者:
H
huyuangang
提交者:
yylgit
4月 09, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixbug
wxml
上级
479d4304
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
32 addition
and
14 deletion
+32
-14
packages/chameleon-loader/src/cml-compile/json-handle.js
packages/chameleon-loader/src/cml-compile/json-handle.js
+1
-1
packages/chameleon-tool-utils/src/index.js
packages/chameleon-tool-utils/src/index.js
+10
-11
packages/chameleon-tool-utils/test/index.test.js
packages/chameleon-tool-utils/test/index.test.js
+16
-0
packages/chameleon-tool-utils/test/testlib/demo-project/node_modules/vant-weapp/test.js
...test/testlib/demo-project/node_modules/vant-weapp/test.js
+0
-0
packages/chameleon-tool-utils/test/testlib/demo-project/node_modules/vant-weapp/test.json
...st/testlib/demo-project/node_modules/vant-weapp/test.json
+1
-0
packages/chameleon-tool-utils/test/testlib/demo-project/node_modules/vant-weapp/test.wxml
...st/testlib/demo-project/node_modules/vant-weapp/test.wxml
+2
-0
packages/chameleon-tool-utils/test/testlib/demo-project/node_modules/vant-weapp/test.wxss
...st/testlib/demo-project/node_modules/vant-weapp/test.wxss
+0
-0
packages/chameleon-tool/configs/getMiniAppBuildConfig.js
packages/chameleon-tool/configs/getMiniAppBuildConfig.js
+1
-1
packages/chameleon-tool/lib/config.js
packages/chameleon-tool/lib/config.js
+1
-1
未找到文件。
packages/chameleon-loader/src/cml-compile/json-handle.js
浏览文件 @
d5e4449b
...
...
@@ -19,7 +19,7 @@ module.exports = function(loaderContext, jsonObject, cmlType) {
}
cmlUtils
.
addNpmComponents
(
jsonObject
,
jsonPath
,
cmlType
,
context
)
return
jsonObject
;
...
...
packages/chameleon-tool-utils/src/index.js
浏览文件 @
d5e4449b
...
...
@@ -678,7 +678,6 @@ _.handleComponentUrl = function (context, cmlFilePath, comPath, cmlType) {
refUrl
}
}
if
(
~
filePath
.
indexOf
(
'
node_modules
'
))
{
refUrl
=
_
.
npmComponentRefPath
(
filePath
,
context
);
// 改为相对路径
...
...
@@ -687,18 +686,18 @@ _.handleComponentUrl = function (context, cmlFilePath, comPath, cmlType) {
}
else
{
// 改成相对路径
refUrl
=
_
.
handleRelativePath
(
cmlFilePath
,
filePath
);
}
refUrl
=
refUrl
.
replace
(
new
RegExp
(
`(\\.cml|\\.
${
cmlType
}
\\.cml)`
),
''
);
if
(
cmlType
===
'
wx
'
)
{
refUrl
=
refUrl
.
replace
(
/
\.
wxml
/g
,
''
);
}
if
(
cmlType
===
'
alipay
'
)
{
refUrl
=
refUrl
.
replace
(
/
\.
axml
/g
,
''
);
}
refUrl
=
refUrl
.
replace
(
new
RegExp
(
`(\\.cml|\\.
${
cmlType
}
\\.cml)`
),
''
);
if
(
cmlType
===
'
wx
'
)
{
refUrl
=
refUrl
.
replace
(
/
\.
wxml$
/g
,
''
);
}
if
(
cmlType
===
'
alipay
'
)
{
refUrl
=
refUrl
.
replace
(
/
\.
axml$
/g
,
''
);
}
if
(
cmlType
===
'
baidu
'
)
{
refUrl
=
refUrl
.
replace
(
/
\.
swan/g
,
''
);
}
if
(
cmlType
===
'
baidu
'
)
{
refUrl
=
refUrl
.
replace
(
/
\.
swan$/g
,
''
);
}
return
{
...
...
packages/chameleon-tool-utils/test/index.test.js
浏览文件 @
d5e4449b
...
...
@@ -365,6 +365,22 @@ describe('index.js', function () {
expect
(
result
.
isCml
).
to
.
equal
(
true
);
})
it
(
'
handleComponentUrl isCml true wxml
'
,
function
()
{
global
.
cml
=
{};
_
.
setCli
(
true
);
cml
.
config
=
require
(
'
./testlib/cli/config.js
'
);
cml
.
utils
=
require
(
'
../src/index.js
'
);
cml
.
projectRoot
=
path
.
join
(
__dirname
,
'
testlib/demo-project
'
);
cml
.
config
.
merge
({
})
var
cmlFilePath
=
path
.
join
(
__dirname
,
'
testlib/demo-project/src/pages/page1/page1.cml
'
);
var
comrefPath
=
'
vant-weapp/test
'
let
result
=
_
.
handleComponentUrl
(
cml
.
projectRoot
,
cmlFilePath
,
comrefPath
,
'
wx
'
);
expect
(
result
.
refUrl
).
to
.
equal
(
'
./../../npm/vant-weapp/test
'
);
})
it
(
'
findInterfaceFile
'
,
function
()
{
global
.
cml
=
{};
_
.
setCli
(
true
);
...
...
packages/chameleon-tool-utils/test/testlib/demo-project/node_modules/vant-weapp/test.js
0 → 100644
浏览文件 @
d5e4449b
packages/chameleon-tool-utils/test/testlib/demo-project/node_modules/vant-weapp/test.json
0 → 100644
浏览文件 @
d5e4449b
{}
\ No newline at end of file
packages/chameleon-tool-utils/test/testlib/demo-project/node_modules/vant-weapp/test.wxml
0 → 100644
浏览文件 @
d5e4449b
<view>
<view>
\ No newline at end of file
packages/chameleon-tool-utils/test/testlib/demo-project/node_modules/vant-weapp/test.wxss
0 → 100644
浏览文件 @
d5e4449b
packages/chameleon-tool/configs/getMiniAppBuildConfig.js
浏览文件 @
d5e4449b
...
...
@@ -33,7 +33,7 @@ module.exports = function (options) {
]
}
if
(
media
===
'
export
'
)
{
return
getMiniAppExportConfig
(
options
);
return
getMiniAppExportConfig
(
merge
(
commonConfig
,
buildConfig
),
options
);
}
return
merge
(
commonConfig
,
buildConfig
)
}
packages/chameleon-tool/lib/config.js
浏览文件 @
d5e4449b
...
...
@@ -27,7 +27,7 @@ var miniappConfig = {
'
process.env.NODE_ENV
'
:
JSON
.
stringify
(
'
production
'
)
},
entry
:
[
'
./components
'
'
./
src/
components
'
],
publicPath
:
'
../../
'
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录