-
Notifications
You must be signed in to change notification settings - Fork 375
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
Fix some error #1252
Fix some error #1252
Conversation
Blackgan3
commented
Aug 10, 2023
- 补充errorHandler文档
- 修复局部构建模式下?resolve语法报错
- 修复局部构建模式下分包输出缺失导致构建产物无法预览问题
packages/webpack-plugin/lib/index.js
Outdated
}, (obj, resolverContext, callback) => { | ||
if (isResolvingPage(obj) && !matchCondition(obj.path, this.options.partialCompile)) { | ||
if (mpx) mpx.partialCompileFilteredPagesMap[obj.path] = true | ||
const { resourcePath } = parseRequest(obj.path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没必要parseRequest
json.subPackages = [] | ||
} | ||
json.subPackages.push(subPackageCfg) | ||
if (!json.subPackages) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
恢复原逻辑
packages/webpack-plugin/package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@mpxjs/webpack-plugin", | |||
"version": "2.8.39", | |||
"version": "2.8.40-beta.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要修改version
return pagesMap[resourcePath] || currentComponentsMap[resourcePath] || mainComponentsMap[resourcePath] || currentStaticResourcesMap[resourcePath] || mainStaticResourcesMap[resourcePath] || '' | ||
const resolveResult = pagesMap[resourcePath] || currentComponentsMap[resourcePath] || mainComponentsMap[resourcePath] || currentStaticResourcesMap[resourcePath] || mainStaticResourcesMap[resourcePath] || '' | ||
if (!resolveResult) { | ||
if (matchCondition(resourcePath, partialCompile)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
partialCompile不一定存在
}, () => { | ||
if (tarRoot && subPackagesCfg) { | ||
if (!subPackagesCfg[tarRoot].pages.length) { | ||
subPackagesCfg[tarRoot].pages.push(pagesCache[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pagesCache[0]不一定有值
} | ||
} else { | ||
if (!localPages.length) { | ||
pagesCache[0] && localPages.push(pagesCache[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
写在上面的if里呗
# Conflicts: # packages/webpack-plugin/package.json