Skip to content

add subPackages#18

Merged
Cap32 merged 2 commits intoCap32:masterfrom
Akiq2016:master
Sep 21, 2018
Merged

add subPackages#18
Cap32 merged 2 commits intoCap32:masterfrom
Akiq2016:master

Conversation

@Akiq2016
Copy link
Contributor

@Akiq2016 Akiq2016 commented Sep 20, 2018

  • resolve the sub packages structure in app.json
  • sub packages related dependencies should not add to common.js #19 #22
    async getEntryResource() {
        const appJSONFile = resolve(this.base, 'app.json');
+       const { pages = [], subPackages = [], tabBar = {} } = await readJson(appJSONFile);

        const components = new Set();
        for (const page of pages) {
            await this.getComponents(components, resolve(this.base, page));
        }

+        for (const subPackage of subPackages) {
+            const { root, pages = [] } = subPackage;

+            await Promise.all(pages.map(async page =>
+                await this.getComponents(components, resolve(this.base, join(root, page)))
+            ));
+        }

        this.getTabBarIcons(tabBar);

        return [
            'app',
            ...pages,
+           ...[].concat(...subPackages.map(v => v.pages.map(w => join(v.root, w)))),
            ...components
        ];
    }

@Cap32 Cap32 merged commit 99d2ac0 into Cap32:master Sep 21, 2018
@Cap32
Copy link
Owner

Cap32 commented Sep 21, 2018

Thanks @Akiq2016 👍🏿

I've released v0.19.0 to npm before the To-Do list completed

@Cap32
Copy link
Owner

Cap32 commented Sep 21, 2018

  • sub packages related dependencies should not add to common.js

I created a new issue ref to it.

@Akiq2016
Copy link
Contributor Author

ok, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants