Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend source code not be build to on bundle.js in electron build #10563

Closed
orange-pig opened this issue Dec 20, 2021 · 3 comments
Closed

Backend source code not be build to on bundle.js in electron build #10563

orange-pig opened this issue Dec 20, 2021 · 3 comments
Labels
electron issues related to the electron target electron-build issues related to building electron

Comments

@orange-pig
Copy link

My application face to desktop, and i build to electron app use electron-builder.

I want not to publish my source code, so i exclude my source code use the follow config all the time.

electron-builder.yml

files:
  - src-gen
  - "!src-gen/frontend/index.*"
  - lib
  - "!**node_modules/electron/**"
  - "!**node_modules/my-project-folder/**"

At same time webpack build to one bundle.js obfuscate my code, a happy times.

Until i added a backend service, my application not running after electron package. And then I find the reason:

Theia's webpack only biuld frontend srouce code to one bundle.js, and backend source code be copyed to 'node_modules/my-project-folder'.

And other, I try to add webpack.backend.config.js to build 'backend/main.js'. Not surprisingly, I failed.

Bug Description:

Package to electron, my backend source code publich with source code.

Steps to Reproduce:

Perpare to add a electron-builder.yml.

  1. yarn
  2. cd electron-app
  3. yarn build
  4. yarn electron dist # or: yarn electron run pack
  5. Running the myApp.exe, Not responding

Info:

  1. Three process name myApp in the windows Task Manager, it look like shell running but main thread broking.
  2. Don't find log file in 'c:/user/MyName/.theia/logs'
  3. Don't find event record in Windows Log
  4. Copy the 'my-project-folder/lib/' into '/resources/node_modules/my-project-folder/', it's woking.

Additional Information

  • Operating System: windows 11
  • Theia Version: 1.18.0

My question

I think it a bug that don't build the backend resource code to one bundle.js with electron-builder. And I try to add webpack.config build the backend/main.js, but it's failed.

So, How to build backend source code to one bundle.js for product source code.

@colin-grant-work colin-grant-work added electron issues related to the electron target electron-build issues related to building electron labels Dec 22, 2021
@anlate
Copy link

anlate commented Mar 11, 2023

I met the same problem, did you solve it?

@orange-pig
Copy link
Author

Not yet! You may be able to compile '*.js' into a bytecode file in another way. Forget the build to bundle.js :)

@msujew
Copy link
Member

msujew commented Apr 11, 2023

Superseeded by #12391.

@msujew msujew closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electron issues related to the electron target electron-build issues related to building electron
Projects
None yet
Development

No branches or pull requests

4 participants