diff --git a/src/internal/config.js b/src/internal/config.js index b0771f3..733327f 100644 --- a/src/internal/config.js +++ b/src/internal/config.js @@ -27,6 +27,10 @@ export async function get_pagefind_config(cwd) { ); const pagefind_parsed = JSON.parse(pagefind_raw); const config = v.parse(PagefindConfigSchema, pagefind_parsed); - config.pagefind_url = config.pagefind_url.replace(/^\/+|\/+$/g, ""); + const pagefind_url = config.vite_plugin_pagefind.pagefind_url; + config.vite_plugin_pagefind.pagefind_url = pagefind_url.replace( + /^\/+|\/+$/g, + "", + ); return config; } diff --git a/src/plugins/pagefind-build.js b/src/plugins/pagefind-build.js index 3f0c0ee..a21d7e0 100644 --- a/src/plugins/pagefind-build.js +++ b/src/plugins/pagefind-build.js @@ -12,7 +12,7 @@ export default function build() { async config() { const cwd = process.cwd(); const pagefind_config = await get_pagefind_config(cwd); - const pagefind_url = pagefind_config.pagefind_url; + const pagefind_url = pagefind_config.vite_plugin_pagefind.pagefind_url; return { build: { rollupOptions: { diff --git a/src/plugins/pagefind-dev.js b/src/plugins/pagefind-dev.js index dda983f..398f88b 100644 --- a/src/plugins/pagefind-dev.js +++ b/src/plugins/pagefind-dev.js @@ -20,7 +20,7 @@ export default function dev() { async config() { const cwd = process.cwd(); const pagefind_config = await get_pagefind_config(cwd); - const pagefind_url = pagefind_config.pagefind_url; + const pagefind_url = pagefind_config.vite_plugin_pagefind.pagefind_url; return { assetsInclude: ["**/pagefind.js", "**/pagefind-highlight.js"], build: {