vite icon indicating copy to clipboard operation
vite copied to clipboard

fix(ssr): `this` in exported function should be `undefined`

Open sapphi-red opened this issue 1 year ago • 8 comments

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.

sapphi-red avatar Oct 11 '24 06:10 sapphi-red