Skip to content

Commit

Permalink
Fixed web export
Browse files Browse the repository at this point in the history
  • Loading branch information
Phara0h committed Jul 8, 2020
1 parent bc21ef7 commit 8d8bbde
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,17 @@ parentName = collection.info.name;

jsFile += genClass(collection.info.name, collection.item, '', collection.info)

if(web) {
jsFile += `
export default function(host){
if(host) {
hostUrl = host;
}
return {${allNewClasses.join()}};
}
`
}
else {
jsFile += `
module.exports= function(host){
if(host) {
Expand All @@ -396,6 +407,8 @@ jsFile += `
return {${allNewClasses.join()}};
}
`
}


console.log(prettier.format(jsFile, {
tabWidth: 2,
Expand Down

0 comments on commit 8d8bbde

Please sign in to comment.