Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-code-divider
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-code-divider
Commits
e600c203
Commit
e600c203
authored
Jan 08, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加自定义模块参数配置功能
parent
1ef1fdb8
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
19 deletions
+63
-19
index.es.js
dist/index.es.js
+15
-4
index.es.js.map
dist/index.es.js.map
+1
-1
index.js
dist/index.js
+15
-4
index.js.map
dist/index.js.map
+1
-1
index.umd.js
dist/index.umd.js
+15
-4
index.umd.js.map
dist/index.umd.js.map
+1
-1
CustomManager.js
src/CustomManager.js
+3
-0
index.js
src/index.js
+12
-4
No files found.
dist/index.es.js
View file @
e600c203
...
...
@@ -149,6 +149,9 @@ var module = {
function getAssetByUUID(uuid){
return engine.resolveCustomAsset('
${
id
}
', uuid);
}
function getProps(){
return engine.getProps('
${
id
}
');
}
${
code
}
})(module);
...
...
@@ -276,10 +279,17 @@ async function divideCode(data, {debug, compile, uglify, getProcesses, getScript
data
.
customs
=
customMetas
.
map
(
item
=>
{
const
custom
=
typeof
item
===
'string'
?
JSON
.
parse
(
item
)
:
item
;
customManager
.
deal
(
custom
);
let
assetMapping
=
customs
.
find
(
c
=>
c
.
id
===
custom
.
id
).
assetMapping
;
for
(
let
uuid
in
assetMapping
){
let
asset
=
custom
.
assets
.
find
(
item
=>
item
.
uuid
===
uuid
);
if
(
asset
){
let
{
props
,
assetMapping
}
=
customs
.
find
(
c
=>
c
.
id
===
custom
.
id
);
if
(
props
)
{
for
(
let
key
in
custom
.
props
)
{
if
(
!
props
.
hasOwnProperty
(
key
)
&&
custom
.
props
[
key
].
hasOwnProperty
(
'default'
))
{
props
[
key
]
=
custom
.
props
[
key
].
default
;
}
}
}
for
(
let
uuid
in
assetMapping
)
{
let
asset
=
custom
.
assets
.
find
(
item
=>
item
.
uuid
===
uuid
);
if
(
asset
)
{
asset
.
url
=
assetMapping
[
uuid
];
}
}
...
...
@@ -287,6 +297,7 @@ async function divideCode(data, {debug, compile, uglify, getProcesses, getScript
id
:
custom
.
id
,
name
:
custom
.
name
,
assets
:
custom
.
assets
,
props
,
};
});
}
...
...
dist/index.es.js.map
View file @
e600c203
This diff is collapsed.
Click to expand it.
dist/index.js
View file @
e600c203
...
...
@@ -155,6 +155,9 @@ var module = {
function getAssetByUUID(uuid){
return engine.resolveCustomAsset('
${
id
}
', uuid);
}
function getProps(){
return engine.getProps('
${
id
}
');
}
${
code
}
})(module);
...
...
@@ -282,10 +285,17 @@ async function divideCode(data, {debug, compile, uglify, getProcesses, getScript
data
.
customs
=
customMetas
.
map
(
item
=>
{
const
custom
=
typeof
item
===
'string'
?
JSON
.
parse
(
item
)
:
item
;
customManager
.
deal
(
custom
);
let
assetMapping
=
customs
.
find
(
c
=>
c
.
id
===
custom
.
id
).
assetMapping
;
for
(
let
uuid
in
assetMapping
){
let
asset
=
custom
.
assets
.
find
(
item
=>
item
.
uuid
===
uuid
);
if
(
asset
){
let
{
props
,
assetMapping
}
=
customs
.
find
(
c
=>
c
.
id
===
custom
.
id
);
if
(
props
)
{
for
(
let
key
in
custom
.
props
)
{
if
(
!
props
.
hasOwnProperty
(
key
)
&&
custom
.
props
[
key
].
hasOwnProperty
(
'default'
))
{
props
[
key
]
=
custom
.
props
[
key
].
default
;
}
}
}
for
(
let
uuid
in
assetMapping
)
{
let
asset
=
custom
.
assets
.
find
(
item
=>
item
.
uuid
===
uuid
);
if
(
asset
)
{
asset
.
url
=
assetMapping
[
uuid
];
}
}
...
...
@@ -293,6 +303,7 @@ async function divideCode(data, {debug, compile, uglify, getProcesses, getScript
id
:
custom
.
id
,
name
:
custom
.
name
,
assets
:
custom
.
assets
,
props
,
};
});
}
...
...
dist/index.js.map
View file @
e600c203
This diff is collapsed.
Click to expand it.
dist/index.umd.js
View file @
e600c203
...
...
@@ -155,6 +155,9 @@ var module = {
function getAssetByUUID(uuid){
return engine.resolveCustomAsset('
${
id
}
', uuid);
}
function getProps(){
return engine.getProps('
${
id
}
');
}
${
code
}
})(module);
...
...
@@ -282,10 +285,17 @@ ${scripts}
data
.
customs
=
customMetas
.
map
(
item
=>
{
const
custom
=
typeof
item
===
'string'
?
JSON
.
parse
(
item
)
:
item
;
customManager
.
deal
(
custom
);
let
assetMapping
=
customs
.
find
(
c
=>
c
.
id
===
custom
.
id
).
assetMapping
;
for
(
let
uuid
in
assetMapping
){
let
asset
=
custom
.
assets
.
find
(
item
=>
item
.
uuid
===
uuid
);
if
(
asset
){
let
{
props
,
assetMapping
}
=
customs
.
find
(
c
=>
c
.
id
===
custom
.
id
);
if
(
props
)
{
for
(
let
key
in
custom
.
props
)
{
if
(
!
props
.
hasOwnProperty
(
key
)
&&
custom
.
props
[
key
].
hasOwnProperty
(
'default'
))
{
props
[
key
]
=
custom
.
props
[
key
].
default
;
}
}
}
for
(
let
uuid
in
assetMapping
)
{
let
asset
=
custom
.
assets
.
find
(
item
=>
item
.
uuid
===
uuid
);
if
(
asset
)
{
asset
.
url
=
assetMapping
[
uuid
];
}
}
...
...
@@ -293,6 +303,7 @@ ${scripts}
id
:
custom
.
id
,
name
:
custom
.
name
,
assets
:
custom
.
assets
,
props
,
};
});
}
...
...
dist/index.umd.js.map
View file @
e600c203
This diff is collapsed.
Click to expand it.
src/CustomManager.js
View file @
e600c203
...
...
@@ -23,6 +23,9 @@ var module = {
function getAssetByUUID(uuid){
return engine.resolveCustomAsset('
${
id
}
', uuid);
}
function getProps(){
return engine.getProps('
${
id
}
');
}
${
code
}
})(module);
...
...
src/index.js
View file @
e600c203
...
...
@@ -100,10 +100,17 @@ export async function divideCode(data, {debug, compile, uglify, getProcesses, ge
data
.
customs
=
customMetas
.
map
(
item
=>
{
const
custom
=
typeof
item
===
'string'
?
JSON
.
parse
(
item
)
:
item
;
customManager
.
deal
(
custom
);
let
assetMapping
=
customs
.
find
(
c
=>
c
.
id
===
custom
.
id
).
assetMapping
;
for
(
let
uuid
in
assetMapping
){
let
asset
=
custom
.
assets
.
find
(
item
=>
item
.
uuid
===
uuid
);
if
(
asset
){
let
{
props
,
assetMapping
}
=
customs
.
find
(
c
=>
c
.
id
===
custom
.
id
);
if
(
props
)
{
for
(
let
key
in
custom
.
props
)
{
if
(
!
props
.
hasOwnProperty
(
key
)
&&
custom
.
props
[
key
].
hasOwnProperty
(
'default'
))
{
props
[
key
]
=
custom
.
props
[
key
].
default
;
}
}
}
for
(
let
uuid
in
assetMapping
)
{
let
asset
=
custom
.
assets
.
find
(
item
=>
item
.
uuid
===
uuid
);
if
(
asset
)
{
asset
.
url
=
assetMapping
[
uuid
];
}
}
...
...
@@ -111,6 +118,7 @@ export async function divideCode(data, {debug, compile, uglify, getProcesses, ge
id
:
custom
.
id
,
name
:
custom
.
name
,
assets
:
custom
.
assets
,
props
,
};
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment