Skip to content

Commit 051ff6c

Browse files
committed
chore: skip via config flag
1 parent d658433 commit 051ff6c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

core/scripts/testing/scripts.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151

5252
// Load theme tokens dynamically instead of stylesheets
5353
// Skip theme loading if using CDN (no local dist directory available)
54-
const isUsingCDN = document.querySelector('script[src*="cdn.jsdelivr.net"]') !== null;
54+
const isUsingCDN = window.Ionic?.config?.importIonicFromCDN || false;
55+
56+
// Only attempt theme loading if not using CDN and theme is valid
5557
if (themeName && ['ionic', 'ios', 'md'].includes(themeName) && !isUsingCDN) {
5658
loadThemeTokens(themeName, paletteName);
5759
}

core/src/utils/test/playwright/page/utils/set-content.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export const setContent = async (page: Page, html: string, testInfo: TestInfo, o
8282
window.Ionic = {
8383
config: {
8484
mode: '${mode}',
85-
theme: '${theme}'
85+
theme: '${theme}',
86+
importIonicFromCDN: ${options?.importIonicFromCDN || false}
8687
}
8788
}
8889
</script>

0 commit comments

Comments
 (0)