@@ -1020,7 +1020,7 @@ var require;
1020
1020
1021
1021
if ( newValue ) {
1022
1022
if ( key === 'urlArgs' && typeof newValue === 'string' ) {
1023
- defaultUrlArgs = newValue ;
1023
+ requireConf . urlArgs [ '*' ] = newValue ;
1024
1024
}
1025
1025
else {
1026
1026
// 简单的多处配置还是需要支持,所以配置实现为支持二级mix
@@ -1071,14 +1071,6 @@ var require;
1071
1071
*/
1072
1072
var mappingIdIndex ;
1073
1073
1074
- /**
1075
- * 默认的urlArgs
1076
- *
1077
- * @inner
1078
- * @type {string }
1079
- */
1080
- var defaultUrlArgs ;
1081
-
1082
1074
/**
1083
1075
* urlArgs内部索引
1084
1076
*
@@ -1152,7 +1144,7 @@ var require;
1152
1144
packagesIndex . sort ( descSorterByKOrName ) ;
1153
1145
1154
1146
// create urlArgs index
1155
- urlArgsIndex = createKVSortedIndex ( requireConf . urlArgs ) ;
1147
+ urlArgsIndex = createKVSortedIndex ( requireConf . urlArgs , 1 ) ;
1156
1148
1157
1149
// create noRequests index
1158
1150
noRequestsIndex = createKVSortedIndex ( requireConf . noRequests ) ;
@@ -1224,13 +1216,9 @@ var require;
1224
1216
1225
1217
// packages处理和匹配
1226
1218
if ( ! isPathMap ) {
1227
- indexRetrieve (
1228
- id ,
1229
- packagesIndex ,
1230
- function ( value , key , item ) {
1231
- url = url . replace ( item . name , item . location ) ;
1232
- }
1233
- ) ;
1219
+ indexRetrieve ( id , packagesIndex , function ( value , key , item ) {
1220
+ url = url . replace ( item . name , item . location ) ;
1221
+ } ) ;
1234
1222
}
1235
1223
1236
1224
// 相对路径时,附加baseUrl
@@ -1242,24 +1230,9 @@ var require;
1242
1230
url += extname + query ;
1243
1231
1244
1232
// urlArgs处理和匹配
1245
- var isUrlArgsAppended ;
1246
1233
indexRetrieve ( id , urlArgsIndex , function ( value ) {
1247
- appendUrlArgs ( value ) ;
1234
+ url += ( url . indexOf ( '?' ) > 0 ? '&' : '?' ) + value ;
1248
1235
} ) ;
1249
- defaultUrlArgs && appendUrlArgs ( defaultUrlArgs ) ;
1250
-
1251
- /**
1252
- * 为url附加urlArgs
1253
- *
1254
- * @inner
1255
- * @param {string } args urlArgs串
1256
- */
1257
- function appendUrlArgs ( args ) {
1258
- if ( ! isUrlArgsAppended ) {
1259
- url += ( url . indexOf ( '?' ) > 0 ? '&' : '?' ) + args ;
1260
- isUrlArgsAppended = 1 ;
1261
- }
1262
- }
1263
1236
1264
1237
return url ;
1265
1238
}
@@ -1282,15 +1255,15 @@ var require;
1282
1255
1283
1256
return requiredCache [ requireId ] ;
1284
1257
}
1285
- else if ( requireId instanceof Array ) {
1258
+ else if ( requireId instanceof Array ) {
1286
1259
// 分析是否有resource,取出pluginModule先
1287
1260
var pluginModules = [ ] ;
1288
1261
var pureModules = [ ] ;
1289
1262
var normalizedIds = [ ] ;
1290
1263
1291
1264
each (
1292
1265
requireId ,
1293
- function ( id , i ) {
1266
+ function ( id , i ) {
1294
1267
var idInfo = parseId ( id ) ;
1295
1268
var absId = normalize ( idInfo . module , baseId ) ;
1296
1269
pureModules . push ( absId ) ;
0 commit comments