vite
vite copied to clipboard
fix(ssr): `this` in exported function should be `undefined`
Description
this in exported function should be undefined but it was not.
reproduction in Node: https://stackblitz.com/edit/node-7bhlmx?file=index.js (make sure you run it locally, it works differently in stackblitz https://github.com/stackblitz/webcontainer-core/issues/1532)
I used an identity function to avoid the this binding. (0, foo.bar) can be used as well, but I thought it will be difficult for the same reason with https://github.com/vitejs/vite/pull/3682.