feat(platform): add ability to override platform detection methods (#23915)

resolves #19737
This commit is contained in:
William Martin
2021-09-14 15:49:04 -04:00
committed by GitHub
parent 414f24685c
commit 45cabae04b
8 changed files with 45 additions and 10 deletions

View File

@ -21,9 +21,6 @@ export const initialize = (userConfig: IonicConfig = {}) => {
Context.config = config;
const Ionic = (win as any).Ionic = (win as any).Ionic || {};
// Setup platforms
setupPlatforms(win);
const platformHelpers: any = {};
if (userConfig._ael) {
platformHelpers.ael = userConfig._ael;
@ -51,6 +48,9 @@ export const initialize = (userConfig: IonicConfig = {}) => {
saveConfig(win, configObj);
}
// Setup platforms
setupPlatforms(win);
// first see if the mode was set as an attribute on <html>
// which could have been set by the user, or by pre-rendering
// otherwise get the mode via config settings, and fallback to md