Skip to content

Commit

Permalink
Fixed the errors in the build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
hankertrix committed Nov 21, 2024
1 parent 452163b commit de5e6f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/internal/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion src/plugins/pagefind-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/pagefind-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit de5e6f8

Please sign in to comment.