Install:
npm install fuse-box --save-dev
import { fusebox } from 'fuse-box';
fusebox({
target: 'browser',
entry: 'src/index.tsx',
webIndex: {
template: 'src/index.html',
},
devServer: true,
}).runDev();
Install:
npm install fuse-box --save-dev
import { fusebox } from 'fuse-box';
fusebox({
target: 'browser',
entry: 'src/index.tsx',
webIndex: {
template: 'src/index.html',
},
devServer: true,
}).runDev();
Electron recommends that nodeIntegration be false and contextIsolation be true in Electron Documentation.
When there's an error from the main process, errors are reported referencing line numbers of JS files in the dist
folder, e.g. the compiled output:
(node:59233) UnhandledPromiseRejectionWarning: TypeError: settings_1.Settings.get(...) is not a function or its return value is not iterable
at SomeCode (/<project path>/dist/main/main.js:231:44)
...etc
at process._tickCallback (internal/process/next_tick.js:68:7)
It'd be awesome if these could be reported back to the developer with source maps so there's a Typescript file and line number there.
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
I'm not sure if other platforms behave differently but on Windows the app won't launch after running npm start
in the console. But I already found why:
Line 31 in fuse.js
says the following:
spawn(`${__dirname}/node_modules/electron/cli.js`, [__dirname])
It works if I change it to:
spawn('node', [`${ __dirname }/node_modules/electron/cli.js`, __dirname ])
Basically running node .../cli.js dist
instead of just .../cli.js dist
.
I'm curious if there is a minimum or maximum supported Node version. I found I had to add async...await for "'build:main'" to get the Fuse dev server to start after the fuse.run() for spawning Electron. I'm happy to create a PR but only if there's an understanding that the supported Node version is a minimum of version 8. At this point, β₯ version 8 seems safe but I don't want to assume.
It would be nice to use typescript in electron.js(main process) π
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.