@mpxjs/webpack-plugin 2.10.6-beta.6 → 2.10.6-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +5 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1413,9 +1413,12 @@ class MpxWebpackPlugin {
|
|
|
1413
1413
|
// 删除root query
|
|
1414
1414
|
if (queryObj.root) request = addQuery(request, {}, false, ['root'])
|
|
1415
1415
|
// wx、ali和web平台支持require.async,其余平台使用CommonJsAsyncDependency进行模拟抹平
|
|
1416
|
-
if (mpx.
|
|
1416
|
+
if (isWeb(mpx.mode) || isReact(mpx.mode)) {
|
|
1417
|
+
// web 和 react 平台支持分包名转换,如果转换tarRoot为空,则降级到主包
|
|
1418
|
+
tarRoot = transAsyncSubNameRules(mpx.asyncSubpackageNameMap, tarRoot)
|
|
1419
|
+
}
|
|
1420
|
+
if (mpx.supportRequireAsync && tarRoot) {
|
|
1417
1421
|
if (isWeb(mpx.mode) || isReact(mpx.mode)) {
|
|
1418
|
-
tarRoot = transAsyncSubNameRules(mpx.asyncSubpackageNameMap, tarRoot)
|
|
1419
1422
|
const depBlock = new AsyncDependenciesBlock(
|
|
1420
1423
|
{
|
|
1421
1424
|
name: tarRoot + '/index'
|