diff --git a/libs/features/personalization/personalization.js b/libs/features/personalization/personalization.js index b108705c27..0dd02c89e9 100644 --- a/libs/features/personalization/personalization.js +++ b/libs/features/personalization/personalization.js @@ -244,7 +244,7 @@ const fetchData = async (url, type = DATA_TYPE.JSON) => { return null; }; -const getBlockProps = (fVal, miloLibs, origin) => { +const getBlockProps = (fVal, config, origin) => { let val = fVal; if (val?.includes('\\')) val = val?.split('\\').join('/'); if (!val?.startsWith('/')) val = `/${val}`; @@ -252,7 +252,7 @@ const getBlockProps = (fVal, miloLibs, origin) => { if (val.startsWith('/libs/')) { /* c8 ignore next 1 */ - val = `${miloLibs}${val.replace('/libs', '')}`; + val = `${config.miloLibs || config.codeRoot}${val.replace('/libs', '')}`; } else { val = `${origin}${val}`; } @@ -595,7 +595,7 @@ const getVariantInfo = (line, variantNames, variants, manifestPath, fTargetId) = variants[vn][action] = variants[vn][action] || []; if (action === 'useblockcode') { - const { blockSelector, blockTarget } = getBlockProps(line[vn], config.miloLibs, origin); + const { blockSelector, blockTarget } = getBlockProps(line[vn], config, origin); variants[vn][action].push({ selector: blockSelector, val: blockTarget,