Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ export async function resolveConfig(
inlineConfig,
root: resolvedRoot,
base,
decodedBase: decodeURI(base),
decodedBase: decodeBase(base),
rawBase: resolvedBase,
publicDir: resolvedPublicDir,
cacheDir,
Expand Down Expand Up @@ -1678,6 +1678,16 @@ export function resolveBaseUrl(
return base
}

function decodeBase(base: string): string {
try {
return decodeURI(base)
} catch {
throw new Error(
'The value passed to "base" option was malformed. It should be a valid URL.',
)
}
}

export function sortUserPlugins(
plugins: (Plugin | Plugin[])[] | undefined,
): [Plugin[], Plugin[], Plugin[]] {
Expand Down