fix: Skip applying esbuild.charset=ascii vite 8 (#2264)

This commit is contained in:
Aaron
2026-04-13 18:54:14 -05:00
committed by GitHub
parent b6059cfe4a
commit 6e20036d6c
+10 -2
View File
@@ -76,8 +76,12 @@ export async function createViteBuilder(
config.legacy.skipWebSocketTokenCheck = true;
// Solves https://github.com/wxt-dev/wxt/issues/353
config.esbuild ??= {};
if (config.esbuild) config.esbuild.charset = 'ascii';
if (isRolldownVersion(vite.version)) {
// TODO: Add charset ascii when supported by oxc
} else {
config.esbuild ??= {};
if (config.esbuild) config.esbuild.charset = 'ascii';
}
const server = getWxtDevServer?.();
@@ -494,3 +498,7 @@ export async function removeEmptyDirs(dir: string): Promise<void> {
// noop on failure - this means the directory was not empty.
}
}
function isRolldownVersion(version: string): boolean {
return Number(version.split('.')[0]) >= 8;
}