alex.wei
alex.wei
Testing with `vitest` is awesome. But `vitest` only supports Vite's configuration. This is where the difficulty lies. I'm also trying to optimize this so that developers can test more easily....
best way: source code: ``` import.meta.env.DEV ? mainWindow.showInactive() : mainWindow.show() ``` in development mode ``` mainWindow.showInactive() ``` in production mode ``` mainWindow.show() ```
Thanks for your suggestion. It is really necessary to add an example using ipc in the template. Of course you can get more in the [documentation](https://electron-vite.org/guide/dev). About sandbox: Read more...
请确认安装了py,并升级node版本
> ``` > placemarkAttributes.imageSource = '../../resources/satellite.svg?asset' > const satellitePlacemark = new WorldWind.Placemark(satellitePosition, true, placemarkAttributes) > placemarkLayer.addRenderable(satellitePlacemark) > wwd.redraw() > ``` > > this path isn't reliable. it doesn't work in...
https://www.electron.build/generated/deboptions
The `base` option should not be set in Electron. I think your problem is not with this option, but with your project structure and configuration.
Maybe your problem is static public assets handling.
`base` option not work in Electron. The recommended way is to add a vite config with the specified different output directories and use vite to bundle your renderer.
- 这个和electron-vite无关,也和迁移无关,这是常识性问题,因为构建目标是cjs,这些cjs内置变量是无法被占用的和改写的,nodejs的内置变量怎么可能被改写呢,所以运行时错误信息就会抛出的。 - 无论你是esm编写还是cjs编写,electron-vite都会自己根据构建目标,做好兼容处理,所以你的这个处理是多余的,你用esm编写就按esm标准即可,当构建到cjs时,像import.meta.url, electron-vite就会去转换成支持cjs。这是现代构建工具的基本功能之一。