Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix(wechat): 引用三方 plugin 时误报错 (#1529)
Browse files Browse the repository at this point in the history
* fix(wechat): 引用三方plugin时误报错

* test: 微信引用三方plugin时增加测试
  • Loading branch information
jaluik authored Apr 19, 2021
1 parent b1f8b85 commit 1e6af3e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.

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

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

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"usingComponents": {
"mini-greet": "/components/mini-greet/index",
"react-greet": "/components/react-greet/index"
"react-greet": "/components/react-greet/index",
"myPlugin": "plugin://myPlugin"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"mini-page": "pages/mini/index",
"react-page": "pages/react/index"
},
"plugins": {
"myPlugin": {
"version": "1.0.0",
"provider": "wxidxxxxxxxxxxxxxxxx"
}
},
"pages": ["pages/mini/index", "pages/react/index"],
"main": "main"
}
3 changes: 3 additions & 0 deletions packages/remax-cli/src/build/entries/NativeEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export default class NativeEntry extends VirtualEntry {
const { usingComponents = {} } = this.readRawManifest();
return Object.keys(usingComponents).reduce((acc: Map<string, NativeEntry>, name: string) => {
const request: string = usingComponents[name];
if (request && request.startsWith('plugin://')) {
return acc;
}
const fileExist = ['.js', '.ts'].some(ext => {
const filename = this.builder.projectPath.resolveAsset(request + ext, this.filename);
if (filename && fs.existsSync(filename)) {
Expand Down

1 comment on commit 1e6af3e

@vercel
Copy link

@vercel vercel bot commented on 1e6af3e Apr 19, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.