@mpxjs/webpack-plugin 2.10.14-beta.13 → 2.10.14-beta.14-1
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
CHANGED
|
@@ -48,6 +48,7 @@ const SplitChunksPlugin = require('webpack/lib/optimize/SplitChunksPlugin')
|
|
|
48
48
|
const fixRelative = require('./utils/fix-relative')
|
|
49
49
|
const parseRequest = require('./utils/parse-request')
|
|
50
50
|
const { transSubpackage } = require('./utils/trans-async-sub-rules')
|
|
51
|
+
const getEntryName = require('./utils/get-entry-name')
|
|
51
52
|
const { matchCondition } = require('./utils/match-condition')
|
|
52
53
|
const processDefs = require('./utils/process-defs')
|
|
53
54
|
const config = require('./config')
|
|
@@ -1450,10 +1451,24 @@ class MpxWebpackPlugin {
|
|
|
1450
1451
|
// wx、ali和web平台支持require.async,其余平台使用CommonJsAsyncDependency进行模拟抹平
|
|
1451
1452
|
if (mpx.supportRequireAsync) {
|
|
1452
1453
|
if (isWeb(mpx.mode) || isReact(mpx.mode)) {
|
|
1453
|
-
|
|
1454
|
+
let depName = tarRoot + '/index'
|
|
1455
|
+
if (isReact(mpx.mode)) {
|
|
1456
|
+
const transRoot = transSubpackage(mpx.transSubpackageRules, tarRoot)
|
|
1457
|
+
if (transRoot !== tarRoot) {
|
|
1458
|
+
if (transRoot === '') {
|
|
1459
|
+
const entryName = getEntryName({
|
|
1460
|
+
_compilation: compilation,
|
|
1461
|
+
resource: parser.state.module.resource
|
|
1462
|
+
})
|
|
1463
|
+
if (entryName) depName = entryName
|
|
1464
|
+
} else {
|
|
1465
|
+
depName = transRoot + '/index'
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1454
1469
|
const depBlock = new AsyncDependenciesBlock(
|
|
1455
1470
|
{
|
|
1456
|
-
name:
|
|
1471
|
+
name: depName
|
|
1457
1472
|
},
|
|
1458
1473
|
expr.loc,
|
|
1459
1474
|
request
|
|
@@ -52,7 +52,7 @@ const inputModeMap = {
|
|
|
52
52
|
digit: 'decimal'
|
|
53
53
|
};
|
|
54
54
|
const Input = forwardRef((props, ref) => {
|
|
55
|
-
const { style = {}, allowFontScaling = false, type = 'text', value, password, 'placeholder-style': placeholderStyle = {}, disabled, maxlength = 140, 'cursor-spacing': cursorSpacing = 0, 'auto-focus': autoFocus, focus, 'confirm-type': confirmType = 'done', 'confirm-hold': confirmHold =
|
|
55
|
+
const { style = {}, allowFontScaling = false, type = 'text', value, password, 'placeholder-style': placeholderStyle = {}, disabled, maxlength = 140, 'cursor-spacing': cursorSpacing = 0, 'auto-focus': autoFocus, focus, 'confirm-type': confirmType = 'done', 'confirm-hold': confirmHold = true, cursor, 'cursor-color': cursorColor, 'selection-start': selectionStart = -1, 'selection-end': selectionEnd = -1, 'enable-var': enableVar, 'external-var-context': externalVarContext, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'adjust-position': adjustPosition = true, 'keyboard-type': originalKeyboardType, bindinput, bindfocus, bindblur, bindconfirm, bindselectionchange,
|
|
56
56
|
// private
|
|
57
57
|
multiline, 'auto-height': autoHeight, bindlinechange } = props;
|
|
58
58
|
const formContext = useContext(FormContext);
|
|
@@ -280,7 +280,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
280
280
|
autoFocus: !!autoFocus || !!focus,
|
|
281
281
|
selection: selectionStart > -1 || typeof cursor === 'number' ? selection : undefined,
|
|
282
282
|
selectionColor: cursorColor,
|
|
283
|
-
blurOnSubmit:
|
|
283
|
+
blurOnSubmit: multiline ? confirmType !== 'return' : confirmHold,
|
|
284
284
|
underlineColorAndroid: 'rgba(0,0,0,0)',
|
|
285
285
|
textAlignVertical: textAlignVertical,
|
|
286
286
|
placeholderTextColor: placeholderStyle?.color,
|
|
@@ -292,7 +292,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
292
292
|
onChange,
|
|
293
293
|
onSelectionChange,
|
|
294
294
|
onContentSizeChange,
|
|
295
|
-
onSubmitEditing: bindconfirm &&
|
|
295
|
+
onSubmitEditing: bindconfirm && onSubmitEditing
|
|
296
296
|
}, !!multiline && confirmType === 'return' ? {} : { enterKeyHint: confirmType }), [
|
|
297
297
|
'type',
|
|
298
298
|
'password',
|
|
@@ -141,7 +141,7 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
|
|
|
141
141
|
'auto-focus': autoFocus,
|
|
142
142
|
focus,
|
|
143
143
|
'confirm-type': confirmType = 'done',
|
|
144
|
-
'confirm-hold': confirmHold =
|
|
144
|
+
'confirm-hold': confirmHold = true,
|
|
145
145
|
cursor,
|
|
146
146
|
'cursor-color': cursorColor,
|
|
147
147
|
'selection-start': selectionStart = -1,
|
|
@@ -471,7 +471,7 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
|
|
|
471
471
|
autoFocus: !!autoFocus || !!focus,
|
|
472
472
|
selection: selectionStart > -1 || typeof cursor === 'number' ? selection : undefined,
|
|
473
473
|
selectionColor: cursorColor,
|
|
474
|
-
blurOnSubmit:
|
|
474
|
+
blurOnSubmit: multiline ? confirmType !== 'return' : confirmHold,
|
|
475
475
|
underlineColorAndroid: 'rgba(0,0,0,0)',
|
|
476
476
|
textAlignVertical: textAlignVertical,
|
|
477
477
|
placeholderTextColor: placeholderStyle?.color,
|
|
@@ -483,7 +483,7 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
|
|
|
483
483
|
onChange,
|
|
484
484
|
onSelectionChange,
|
|
485
485
|
onContentSizeChange,
|
|
486
|
-
onSubmitEditing: bindconfirm &&
|
|
486
|
+
onSubmitEditing: bindconfirm && onSubmitEditing
|
|
487
487
|
},
|
|
488
488
|
!!multiline && confirmType === 'return' ? {} : { enterKeyHint: confirmType }
|
|
489
489
|
),
|