Closed nanfb closed 1 month ago
Hey @nanfb, could you post your issue in english? I'm not sure if I understand your problem when I put it in the translator.
嘿@nanfb,你能用英语发布你的问题吗?我不确定当我把它放在翻译器中时我是否理解你的问题。
Of course, I use electron to nest my original web project, but the static resource paths of the web project are packaged as network paths, which can't be used directly in electron, can electron-builder solve this problem, I'm now dealing with it manually when packing the renderer, which is not very convenient!
嘿嘿@nanfb,你能用英语发布你的问题吗?我不确定当我把它放在翻译器上时我是否理解你的问题。
当然我是用Electron来嵌套我原来的Web项目的,但是Web项目的静态资源路径都封装成了网络路径,在Electron中是不能直接使用的,Electron-Builder能否解决这个问题呢,我现在打包渲染器的时候手动处理,不太方便! This is how I currently handle it
So your webproject is already bundled, and you want to include it to Electron.
From my understanding the /css/
look ups won't work as they try to access the file from system's root (/
)
I don't think Electron Builder has any features related to processing project files, as it's only used to bundle existing files them up into another binary.
Although the project is already "pre-built", you should still be able to build them (again) using Vite. Vite should be able to find the pre-built css/js files and create correct references.
Is there any reason why you can't use Vite?
So your webproject is already bundled, and you want to include it to Electron. From my understanding the
/css/
look ups won't work as they try to access the file from system's root (/
)I don't think Electron Builder has any features related to processing project files, as it's only used to bundle existing files them up into another binary.
Although the project is already "pre-built", you should still be able to build them (again) using Vite. Vite should be able to find the pre-built css/js files and create correct references.
Is there any reason why you can't use Vite? You are right, I implemented this functionality by writing a vite plugin
我们有个web项目,web项目使用webpack打包后静态资源的路径是/开头的,但是在electron中是被作为静态资源访问的,环境不一样,就会导致访问不到,我想知道有什么办法可以处理吗
这是原来的路访问不到,必须使用静态资源路径,这样导致要手动修改很麻烦我在build脚本中是直接复制dist到rernderer
![image](https://github.com/Deluze/electron-vue-template/assets/56207464/cf9e81a3-a6ff-4250-b101-1943fc0d8785)