electron-vite icon indicating copy to clipboard operation
electron-vite copied to clipboard

feat: Transform classes before compiling into bytecode

Open radislav opened this issue 2 years ago • 2 comments

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

radislav avatar Sep 29 '23 05:09 radislav

@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 avatar Oct 05 '23 13:10 alex8088

@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

radislav avatar Oct 05 '23 13:10 radislav