alex8088 / electron-vite-boilerplate Goto Github PK
View Code? Open in Web Editor NEWComprehensive and security Electron template (TypeScript + Vue3 + Vite).
Home Page: https://electron-vite.org
Comprehensive and security Electron template (TypeScript + Vue3 + Vite).
Home Page: https://electron-vite.org
yarn install
yarn install v1.22.19
warning package.json: No license field
warning ..\package.json: No license field
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning [email protected]: No license field
[1/4] Resolving packages...
warning electron-builder > app-builder-lib > [email protected]: Please use @electron/osx-sign moving forward. Be aware the API is slightly different
warning electron-builder > app-builder-lib > @electron/universal > [email protected]: Please use @electron/asar moving forward. There is no API change, just a package name change
warning vue > @vue/compiler-sfc > magic-string > [email protected]: Please use @jridgewell/sourcemap-codec instead
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/3] ⠄ electron
[-/3] ⡀ waiting...
error E:\VSCode\React\chatpot\v0.0.1\electron-vite-boilerplate\node_modules\electron: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: E:\VSCode\React\chatpot\v0.0.1\electron-vite-boilerplate\node_modules\electron
Output:
RequestError: connect ETIMEDOUT 185.199.110.133:443
at ClientRequest. (E:\VSCode\React\chatpot\v0.0.1\electron-vite-boilerplate\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (node:events:628:26)
at ClientRequest.emit (node:events:525:35)
at origin.emit (E:\VSCode\React\chatpot\v0.0.1\electron-vite-boilerplate\node_modules@szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (node:_http_client:502:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
I looked a bit but didn't see any examples of how to use messaging between process in a svelte application.
Can you give some hints?
when I try import { ipcRenderer } from "electron";
in a TS render process file I get the error:
browser-external:path:9 Module "path" has been externalized for browser compatibility. Cannot access "path.join" in client code. get @ browser-external:path:9 index.js:4 Uncaught ReferenceError: __dirname is not defined at node_modules/electron/index.js (index.js:4:28) at __require2 (chunk-7FP5O474.js?v=b49c6588:10:50) at index.js:21:34
Thanks
Hi, can you explain why application frameworks like vue
or electron
are listed in devDependencies
instead of dependencies
? That seem a bit unexpected.
Thanks
Hello @alex8088
I was looking for help in creating an Electron app managed by Vite and using Lit components, and I found this repo, which uses Vue components.
I cloned your electron-vite-boilerplate
and I ran successfully the resulting Vue app (both dev
and build:mac
).
I congratulate you for the nice clean project, which runs without any problems.
Since I have more experience with Lit than with Vue, React, Svelte, Solid, e.t.c., I tried (and succeeded) to transform your project into my electron-vite-boilerplate-lit, which I just published on github.
I preserved the project code structure, but I replaced the Vite support and components by the similar Lit support and components.
Now, could you please look at my project and comment on it?
Then, if you find it interesting and useful, would you consider adding a fork or clone of my project to your repo, for better visibility? You would be welcome to modify and improve it, as you would see fit.
I also looked at you collection of templates in your quick-start...create-electron, and I created a couple of test projects (a vanilla and a vue project). These also ran without any problems.
My alternate or additional suggestion would be to add the lit
and lit-ts
templates to your collection. I am sure that this would be easy to do for you, as you know your workflow for adding and testing these templates.
Please let me know what you think of my suggestions.
Best regards, @rudifa
Shouldnt the tsconfig.node.json include all files in src/main and src/preload instead of only the root ones?
So instead of:
"include": ["electron.vite.config.*", "src/main/*", "src/preload/*"],
use this:
"include": ["electron.vite.config.*", "src/main/**/*", "src/preload/**/*"],
Hello Alex,
First of all, thank you for the work you have done. your repo is the best for the electron part with vite and vuejs.
But just a question when I configure the Router vuejs and I build it does not work knowing that by doing a yarn dev it works very well.
it works with yarn start and yarn dev but it doesn't work after build (linux).
I don't get any error but anything related to router-view or router link doesn't work
do you have an idea ? thank you
在新增了 mqtt 的包之后,开发过程中一切顺利,打包之后,直接报错:‘找不到 node_modules/debug/src/index.js 文件’
解压打包之后的 app.asar 文件后,查看里面的 node_modules/debug 文件夹,发现里面除了 package.json 和 LICENSE 文件外,都是空的,对比本地的 node_modules/debug 文件,少了 src 文件夹。
瞬间懵了:包打进去了,但是没有源代码?什么情况???第一次碰到这种情况,npm, yarn, pnpm 都用过,还是不行,纠结一天后,发现了问题的原因,定位到了是 electron-builder 的配置问题,一脸尴尬...
node_modules/debug/src 中了 electron-builder.yml 中 files 的 '!**/src/' 配置,被忽略了。虽然知道这个是为了减少包的大小,但是此配置同样也会影响到了 node_modules 里面的文件,把此配置改为 '!src/' 即可。。。
望作者改进。。。
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.