-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add package process #2
Comments
Guys, it would be really cool to show how can one package this. It seems that target: 'electron' does not work properly and largely behaves like target: 'browser'. For example it packages fake crypto, fake fs, path and others. Also, when 'electron' is packaged into vendor module it seizes to work ;( |
A bit more detail. I could get basic packaging to work, but the moment I tried using electron code in my app it crashes. Example: const electron = require('electron');
var db = new DataStore({
filename: path.join(electron.app.getPath('userData'), 'data.db'),
autoload: true
});
const userDataPath = (electron.app || electron.remote.app).getPath('userData'); [EDITED] Please note that I have to package vendor.js as "target:server" not "target:electron" |
Any idea why? |
Hi @tomitrescak, where you test it? From ./src dir (Renderer process) or in our electron.js (Main process)? |
It seems that target:electron is misbehaving and adding browser versions of packages (the ones from modules directory) My test was following: I have copied a blank Electron.app to build directory, copied electron.app. Then I have pointed the fuse output to Electron.app/MacOS/content/resources/app. I have also set up vendor bundle to copy to the same directory. |
I try you example and it seam to work:
and its works (logs to console right location) in both envs:
|
Yes, that this DOES work, but it will stop to work once you package vendor.js. So, try to package vendor.js to your Electron.app and you'll see what I'm talking about. Currently the only way to make it work is to 'npm install' also inside the Electron.app folder which is a bit cumbersome since the whole point of packagers is to package it into few files. |
I am beginner in this whole electron business so maybe I am not doing something right. So maybe instead of trying to explain my setup (that may be very wrong), is there any guide on how can I package my electron app into Mac.app with fusebox packager? Or even with using asar? I tried webpack setups, but: once you go Fuse, Webpack's old news. Webpack setups are HUGE and SLOW and COMPLEX and Typescript is its enemy. I love the simplicity and SPEED of fuesbox. Most webpack boilerplates were hot reloading in 2-3 seconds ... go figure how much it takes Fusebox. I would love to solve this one. |
I have try to get it build right on my repo: https://github.com/kfiku/piGit with ubuntu linux. I think base version will be done next week |
OK, will wait for any update. I'll play with the setup myself/ Meanwhile, @nchanged would you have any idea why "target: electron" is using shimmed modules and not original ones? For example, bcrypt is shimmed, fs .... pretty much everything. |
@tomitrescak I think you need to use |
@tomitrescak What you mean "is shimmed"? Some features are missing? Works differently? Can you give some examples so i can test it? |
@tomitrescak i make pull request with all package stuff here: #6, you can check it it works for you |
Looks great! I'll play with it ASAP. Good job ;) |
Hi!
First, thanks for this cool starter, electron + fusebox is just blazing fast and it produce a very good dx 😍
For a complete electron starter, we need to add the package process! (essential for an electron app)
I'm trying to do this process on my current project (private repo, sorry) but it's not really easy to deal with main.ts/app.tsx/vendors and all assets (icons, images…) to have the perfect bundle!
So if someone have already do this job before, it can be very cool to consolidate this really good starter 😄 (otherwise, I will probably considate this myself, when my stack will working)
Note: I think https://github.com/electron-userland/electron-builder can do the job, but it's just a suggestion
The text was updated successfully, but these errors were encountered: