diff --git a/examples/iframe/utils.mjs b/examples/iframe/utils.mjs index d5e81c1d655..13627dc04a1 100644 --- a/examples/iframe/utils.mjs +++ b/examples/iframe/utils.mjs @@ -3,7 +3,7 @@ import config from '@examples/config'; const href = window.top?.location.href ?? ''; const params = getQueryParams(href); const url = new URL(href); -const root = url.pathname.replace(/\/[^/]+\.html$/g, ''); +const root = url.pathname.replace(/\/([^/]+\.html)?$/g, ''); /** * @type {string} diff --git a/examples/src/app/paths.mjs b/examples/src/app/paths.mjs index e47c59a66ad..8b09cb6e5e2 100644 --- a/examples/src/app/paths.mjs +++ b/examples/src/app/paths.mjs @@ -1,6 +1,6 @@ const href = typeof location !== 'undefined' ? location.href : ''; const url = new URL(href); -const root = url.pathname.replace(/\/[^/]+\.html$/g, ''); +const root = url.pathname.replace(/\/([^/]+\.html)?$/g, ''); export const assetPath = root + '/static/assets/';