alex8088 / electron-vite

Next generation Electron build tooling based on Vite 新一代 Electron 开发构建工具,支持源代码保护
https://electron-vite.org
MIT License
3.46k stars 148 forks source link

Injection of esm shims fails when project type is module #627

Open jeffreymb opened 1 month ago

jeffreymb commented 1 month ago

Describe the bug

When using this together with sentry (https://github.com/getsentry/sentry-electron), the shimming of __filename and __dirname fail.

This can be reproduced with this repo: https://github.com/jeffreymb/electron_vite_sentry

I initially submitted an issue to sentry: https://github.com/getsentry/sentry-electron/issues/992

Electron-Vite Version

2.3.0

Electron Version

32.1.2

Vite Version

5.4.8

Validations

steveoh commented 2 weeks ago

This is affecting me also. Watching...