Skip to content

Commit

Permalink
fix(cli): fix global components
Browse files Browse the repository at this point in the history
enable global components, record the origin app.json file content.
  • Loading branch information
Genuifx committed Jul 22, 2019
1 parent e0cc3b4 commit 42c31dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 38 deletions.
47 changes: 13 additions & 34 deletions packages/wxa-cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/wxa-cli/src/compilers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ export default class Compiler {
}

if (mdl.src === this.$scheduer.APP_CONFIG_PATH) {
this.$scheduer.appConfigs = Object.assign({}, mdl.json);
// global components in wxa;
// delete custom field in app.json or wechat devtool will get wrong.
delete mdl.json['wxa.globalComponents'];
}


mdl.code = JSON.stringify(mdl.json, void(0), 4);
return children;
}
Expand Down
3 changes: 0 additions & 3 deletions packages/wxa-cli/src/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,6 @@ class Schedule {

// if module is app.json, then add Page entry points.
if (dep.meta && dep.meta.source === this.APP_CONFIG_PATH) {
this.appConfigs = {...dep.json};
debug('app configs is %O', dep.json);

let oldPages = new Map(this.$pageArray.entries());
let newPages = this.addPageEntryPoint();
newPages = new Map(newPages.map((page)=>[page.src, page]));
Expand Down

0 comments on commit 42c31dd

Please sign in to comment.