@@ -8,6 +8,7 @@ const addQuery = require('../utils/add-query')
88const parseComponent = require ( '../parser' )
99const getJSONContent = require ( '../utils/get-json-content' )
1010const resolve = require ( '../utils/resolve' )
11+ const { transSubpackage } = require ( '../utils/trans-async-sub-rules' )
1112const createJSONHelper = require ( '../json-compiler/helper' )
1213const getRulesRunner = require ( '../platform/index' )
1314const { RESOLVE_IGNORED_ERR } = require ( '../utils/const' )
@@ -146,15 +147,16 @@ module.exports = function (jsonContent, {
146147
147148 const fillInComponentsMap = ( name , entry , tarRoot ) => {
148149 const { resource, outputPath } = entry
149- const { resourcePath, queryObj } = parseRequest ( resource )
150+ const { resourcePath } = parseRequest ( resource )
151+ tarRoot = transSubpackage ( mpx . transSubpackageRules , tarRoot )
150152 componentsMap [ resourcePath ] = outputPath
151153 loaderContext . _module && loaderContext . _module . addPresentationalDependency ( new RecordResourceMapDependency ( resourcePath , 'component' , outputPath ) )
152154 localComponentsMap [ name ] = {
153155 resource : addQuery ( resource , {
154156 isComponent : true ,
155157 outputPath
156158 } ) ,
157- async : queryObj . async || tarRoot
159+ async : tarRoot
158160 }
159161 }
160162
@@ -288,7 +290,7 @@ module.exports = function (jsonContent, {
288290 if ( err ) return callback ( err === RESOLVE_IGNORED_ERR ? null : err )
289291 if ( pageKeySet . has ( key ) ) return callback ( )
290292 pageKeySet . add ( key )
291- const { resourcePath, queryObj } = parseRequest ( resource )
293+ const { resourcePath } = parseRequest ( resource )
292294 if ( localPagesMap [ outputPath ] ) {
293295 const { resourcePath : oldResourcePath } = parseRequest ( localPagesMap [ outputPath ] . resource )
294296 if ( oldResourcePath !== resourcePath ) {
@@ -300,9 +302,11 @@ module.exports = function (jsonContent, {
300302
301303 pagesMap [ resourcePath ] = outputPath
302304 loaderContext . _module && loaderContext . _module . addPresentationalDependency ( new RecordResourceMapDependency ( resourcePath , 'page' , outputPath ) )
305+ // 通过asyncSubPackagesNameRules对tarRoot进行修改,仅修改tarRoot,不修改outputPath页面路径
306+ tarRoot = transSubpackage ( mpx . transSubpackageRules , tarRoot )
303307 localPagesMap [ outputPath ] = {
304308 resource : addQuery ( resource , { isPage : true } ) ,
305- async : queryObj . async || tarRoot ,
309+ async : tarRoot ,
306310 isFirst
307311 }
308312 callback ( )
0 commit comments