Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix: remove crossorigin attribute from built HTML for Tauri compatibility

esengineae7191651df1
diff --git a/desktop/vite.config.ts b/desktop/vite.config.ts
index ff470cd11..f94131734 100644
--- a/desktop/vite.config.ts
+++ b/desktop/vite.config.ts
@@ -1,9 +1,20 @@
-import { defineConfig } from 'vite';
+import { defineConfig, type Plugin } from 'vite';
const host = process.env.TAURI_DEV_HOST;
+function removeCrossorigin(): Plugin {
+ return {
+ name: 'remove-crossorigin',
+ enforce: 'post',
+ transformIndexHtml(html) {
+ return html.replace(/ crossorigin/g, '');
+ },
+ };
+}
+
export default defineConfig({
clearScreen: false,
+ plugins: [removeCrossorigin()],
server: {
port: 5173,
strictPort: true,