fix: Skip applying esbuild.charset=ascii vite 8 (#2264)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user