New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support for define global constants #743
Conversation
✔️ Deploy Preview for vitest-dev ready! 🔨 Explore the source changes: 674fb04 🔍 Inspect the deploy log: https://app.netlify.com/sites/vitest-dev/deploys/6208b563b377250008847373 😎 Browse the preview: https://deploy-preview-743--vitest-dev.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you find the real reason why contant's weren't defined in Vue?
Also shouldn't they be statically replaced? And not just declared on a global? |
the file will generate vite ssr code, and exec in the vm. and the vm don't had load vite env. vite env inject the global vari when run in the serve or ssr mode. |
Oh, interesting finding. But I guess importing vitest/packages/vite-node/src/cli.ts Lines 87 to 88 in d55736d
|
oh, they only run in the difference worker, vm had the same context with worker 😂 |
fix: #706
use vite load module and exec the module in the vm, the pr support the define var in the vm.