dromara / dromara/electron-egg
mainServer中配置protocol为http似乎没有效果
- Dominant language
- JavaScript
- Stars
- 2.5k
- Forks
- 336
- PR merge metrics
- No merged PRs in 30d
Description
拉取最新的4.2.0项目代码,然后在electron/config/config.default.js中配置如下:
```
mainServer: {
indexPath: '/public/dist/index.html',
channelSeparator: '/',
protocol: 'http://',
host: 'localhost',
port: 8080,
}
```
然后运行build,再运行start
打开调试工具看到js、css等引用资源仍然是file前缀。
我需要修改这里是因为遇到了图片等静态资源无法展示的问题。
我已经在vite.config.js中配置了
```
base: './',
```
其他js脚本加载都正常,但图片仍然存在问题。
图片在build以后,路径为`public/dist/logo.png`,与index.html是同层。
代码中引入时,写的是`./logo.png`,也尝试了`/logo.png`
但运行start后,在调试工具里看到的路径是`file:///logo.png`,仍然无法打开。
能在frontend中添加一个引用静态图片资源的示例吗?不是import图片路径变量或者用`~@`前缀开头的方式
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.