fix(cors): load /devv-app.js via runtime injection to avoid vite build resolution

This commit is contained in:
Chenwei Jiang 2025-08-21 17:19:33 +08:00
parent ba92de04f2
commit 5a111a3d3e
Signed by: cheverjohn
GPG key ID: ADC4815BFE960182

View file

@ -9,8 +9,15 @@
</head>
<body>
<div id="root"></div>
<!-- IMPORTANT: Keep this script for advanced features; proxied via server to avoid CORS -->
<script src="/devv-app.js" type="module"></script>
<!-- IMPORTANT: Load external tool via runtime injection to avoid Vite resolving at build time -->
<script>
(function() {
var s = document.createElement('script');
s.type = 'module';
s.src = '/devv-app.js';
document.head.appendChild(s);
})();
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>