@mpxjs/webpack-plugin 2.10.14-beta.14-input → 2.10.14-beta.14-4
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 +10 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1448,9 +1448,17 @@ class MpxWebpackPlugin {
|
|
|
1448
1448
|
// 删除root query
|
|
1449
1449
|
if (queryObj.root) request = addQuery(request, {}, false, ['root'])
|
|
1450
1450
|
// wx、ali和web平台支持require.async,其余平台使用CommonJsAsyncDependency进行模拟抹平
|
|
1451
|
-
|
|
1451
|
+
let shouldSplitChunk = mpx.supportRequireAsync
|
|
1452
|
+
if (shouldSplitChunk && isReact(mpx.mode)) {
|
|
1453
|
+
const transTarRoot = transSubpackage(mpx.transSubpackageRules, tarRoot)
|
|
1454
|
+
tarRoot = transTarRoot
|
|
1455
|
+
if (transTarRoot === '') {
|
|
1456
|
+
shouldSplitChunk = false
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
if (shouldSplitChunk) {
|
|
1452
1461
|
if (isWeb(mpx.mode) || isReact(mpx.mode)) {
|
|
1453
|
-
if (isReact(mpx.mode)) tarRoot = transSubpackage(mpx.transSubpackageRules, tarRoot)
|
|
1454
1462
|
const depBlock = new AsyncDependenciesBlock(
|
|
1455
1463
|
{
|
|
1456
1464
|
name: tarRoot + '/index'
|