mirror of
https://github.com/dpup/meshstream.git
synced 2026-03-28 17:42:37 +01:00
Fix __publicField polyfill via index.html instead of vite define
esbuild's define only accepts literals/identifiers, not arrow functions. Inject the polyfill as a plain script tag before the module entry point so it is available when any pre-compiled dependency uses it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script>window.__publicField = function(a, b, c) { a[b] = c; return c; };</script>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -20,13 +20,6 @@ export default defineConfig({
|
||||
setupFiles: ['./src/test/setup.ts'],
|
||||
css: true,
|
||||
},
|
||||
optimizeDeps: {
|
||||
esbuildOptions: {
|
||||
define: {
|
||||
'__publicField': '(a,b,c)=>(a[b]=c,c)',
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 5747,
|
||||
proxy: {
|
||||
|
||||
Reference in New Issue
Block a user