@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.
Files changed (2) hide show
  1. package/lib/index.js +10 -2
  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
- if (mpx.supportRequireAsync) {
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'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.14-beta.14-input",
3
+ "version": "2.10.14-beta.14-4",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"