diff --git a/packages/docs/src/repl/monaco.tsx b/packages/docs/src/repl/monaco.tsx index 762ab5d0490..e6698852a62 100644 --- a/packages/docs/src/repl/monaco.tsx +++ b/packages/docs/src/repl/monaco.tsx @@ -218,9 +218,10 @@ export const addQwikLibs = async (version: string) => { }; const loadDeps = async (qwikVersion: string) => { - const [M, m, p] = qwikVersion.split('-')[0].split('.').map(Number); + const isDev = qwikVersion.includes('dev'); + const v = qwikVersion.split('-')[0].split('.').map(Number); const prefix = - qwikVersion === 'bundled' || M > 1 || (M == 1 && (m > 7 || (m == 7 && p >= 2))) + qwikVersion === 'bundled' || (v[0] >= 1 && v[1] >= 7 && v[2] >= (isDev ? 1 : 2)) ? '/dist/' : '/'; const deps: NodeModuleDep[] = [ diff --git a/packages/docs/src/repl/repl.tsx b/packages/docs/src/repl/repl.tsx index b68ad72f894..ba14118b38c 100644 --- a/packages/docs/src/repl/repl.tsx +++ b/packages/docs/src/repl/repl.tsx @@ -168,8 +168,9 @@ export const receiveMessageFromReplServer = ( const getDependencies = (input: ReplAppInput) => { const out = { ...bundled }; if (input.version !== 'bundled') { - const [M, m, p] = input.version.split('-')[0].split('.').map(Number); - const prefix = M > 1 || (M == 1 && (m > 7 || (m == 7 && p >= 2))) ? '/dist/' : '/'; + const v = input.version.split('-')[0].split('.').map(Number); + const prefix = + v[0] > 1 || (v[0] == 1 && (v[1] > 7 || (v[1] == 7 && v[2] >= 2))) ? '/dist/' : '/'; out[QWIK_PKG_NAME] = { version: input.version, }; diff --git a/packages/docs/src/repl/worker/app-bundle-client.ts b/packages/docs/src/repl/worker/app-bundle-client.ts index 74ff58fb243..439c298d28b 100644 --- a/packages/docs/src/repl/worker/app-bundle-client.ts +++ b/packages/docs/src/repl/worker/app-bundle-client.ts @@ -18,8 +18,7 @@ export const appBundleClient = async ( debug: options.debug, srcInputs: getInputs(options), // Older versions don't support `segment` - entryStrategy: - options.entryStrategy.type === 'segment' ? { type: 'hook' } : options.entryStrategy, + entryStrategy: options.entryStrategy === 'segment' ? 'hook' : options.entryStrategy, manifestOutput: (m) => { result.manifest = m; }, diff --git a/packages/docs/src/repl/worker/repl-dependencies.ts b/packages/docs/src/repl/worker/repl-dependencies.ts index 63a00210de0..3c1ad1f2043 100644 --- a/packages/docs/src/repl/worker/repl-dependencies.ts +++ b/packages/docs/src/repl/worker/repl-dependencies.ts @@ -9,8 +9,8 @@ let cache: Cache; export const depResponse = async (pkgName: string, pkgPath: string) => { if (pkgName === QWIK_PKG_NAME && !pkgPath.startsWith('/bindings')) { const version = options.deps[pkgName].version; - const [M, m, p] = version.split('-')[0].split('.').map(Number); - if (M > 1 || (M == 1 && (m > 7 || (m == 7 && p >= 2)))) { + const v = version.split('-')[0].split('.').map(Number); + if (v[0] > 1 || (v[0] == 1 && (v[1] > 7 || (v[1] == 7 && v[2] >= 2)))) { pkgPath = `/dist${pkgPath}`; } }