electron-vite
electron-vite copied to clipboard
feat: Transform classes before compiling into bytecode
Add classes transforming for bytecode plugin to be able to compile into bytecode more packages
Additional context
What is the purpose of this pull request?
- [ ] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [x] Other
Before submitting the PR, please make sure you do the following
- [x] Read the Contributing Guidelines.
- [x] Read the Pull Request Guidelines and follow the Commit Convention.
- [x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g.
fixes #123).
@radislav
Thank you for your contribution.
This problem usually occurs because the third-party module used uses unconventional class writing methods. But if the module supports cjs, automatically excluding the build through the externalizeDevPlugin (making sure the module is installed in deps), this problem will not occur. But if the module only supports esm, this class writing method is not supported. Although it needs to be rebuilt, this problem will not occur.
I'm aware that this problem exists :thinking: , but I haven't come across a module that doesn't solve it via the externiazedep plugin. Because it is more reasonable to solve this problem via the externiazedep plugin, can you list the modules that need to be handled this way? Or provide more detailed information.
@alex8088
I found this issue with bottleneck, socks-proxy-agent and crypto-js
It was ok when I used require without externalizing, but I decided I needed to keep dependencies clear for my own reason :) And these 3 packages stopped me until I used this fix