Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support Component #5

Merged
merged 3 commits into from
Nov 14, 2017
Merged

support Component #5

merged 3 commits into from
Nov 14, 2017

Conversation

nite-knite
Copy link

支持编译被 page 引用的 component

src/index.js Outdated
const { usingComponents = {} } =
await readJson(`${instance}.json`).catch(::console.error);
const componentBase = parse(instance).dir;
for (const relativeComponent of Object.values(usingComponents)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为了兼容 Node.js 低于 v7 版本,需要用 lodash.values() 代替 Object.values()

@Cap32
Copy link
Owner

Cap32 commented Nov 14, 2017

Nice!

只是小问题,为了兼容低于 v7 版本 Node.js,这里 https://github.com/nkCoding/wxapp-webpack-plugin/blob/34fb87a1e3f2bbdc10593ee6c4433932985e205e/src/index.js#L157 需要使用 lodash.values() 代替 Object.values()

@nite-knite
Copy link
Author

已改用 lodash.values()
处理了省略 page 对应的 json 文件的情况;json 文件格式异常时打印错误并继续。

@Cap32 Cap32 merged commit 4e3eee1 into Cap32:master Nov 14, 2017
@Cap32
Copy link
Owner

Cap32 commented Nov 14, 2017

谢谢 @NKCoding

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.

None yet

2 participants