Update cordova hostname customization support (#944)
* Update cordova hostname customization support * Update requestArgs.ts * Update jsDebugConfigAdapter.ts * Gulp format * Revert gulp format * Update pathMapping hostname value * Validation argument correction --------- Co-authored-by: Rodolfo Liberado (BEYONDSOFT CONSULTING INC) <v-rliberado@microsoft.com> Co-authored-by: Ezio Li <v-yukl@microsoft.com>
This commit is contained in:
Родитель
5a6ecbfb57
Коммит
65d84450b7
10
package.json
10
package.json
|
@ -502,6 +502,11 @@
|
|||
"type": "boolean",
|
||||
"description": "%cordova.properties.launch.spaUrlRewrites%",
|
||||
"default": false
|
||||
},
|
||||
"hostname":{
|
||||
"type": "string",
|
||||
"description": "%cordova.properties.launch.hostname%",
|
||||
"default": "localhost"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -591,6 +596,11 @@
|
|||
"webpack:///./~/*": "${cwd}/node_modules/*",
|
||||
"./*": "${cwd}/*"
|
||||
}
|
||||
},
|
||||
"hostname":{
|
||||
"type": "string",
|
||||
"description": "%cordova.properties.launch.hostname%",
|
||||
"default": "localhost"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,9 +49,15 @@ export class JsDebugConfigAdapter {
|
|||
const isWebviewLoader =
|
||||
ConfigurationHelper.getAndroidInsecureFileModeStatus(xmlContent);
|
||||
if (isWebviewLoader) {
|
||||
extraArgs.pathMapping = {
|
||||
"localhost/**": `${attachArgs.cwd}/**`,
|
||||
};
|
||||
if (attachArgs.hostname == "" || attachArgs.hostname == undefined) {
|
||||
extraArgs.pathMapping = {
|
||||
"localhost/**": `${attachArgs.cwd}/**`,
|
||||
};
|
||||
} else {
|
||||
extraArgs.pathMapping = {
|
||||
[`${attachArgs.hostname}/**`]: `${attachArgs.cwd}/**`,
|
||||
};
|
||||
}
|
||||
extraArgs.url = "https://";
|
||||
extraArgs.urlFilter = "*";
|
||||
} else {
|
||||
|
|
|
@ -29,6 +29,7 @@ export interface ICordovaAttachRequestArgs extends DebugProtocol.AttachRequestAr
|
|||
attachTimeout?: number;
|
||||
simulatorInExternalBrowser?: boolean;
|
||||
runtimeVersion?: string;
|
||||
hostname?: string;
|
||||
|
||||
// iOS debug properties
|
||||
iOSVersion?: string;
|
||||
|
|
Загрузка…
Ссылка в новой задаче