-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
electron打包问题 #242
Comments
electron-builder 在配置中的 files 里面添加路径 |
是的 |
好的,那路径是要写'/electron/utils'?然后就会拷贝到dist文件夹里的electron文件夹了吗? |
这个并不会拷贝到dist目录,而是直接打包到asar的根目录 建议在vite配置里面写一段 |
其实打包到asar没有问题,只是开发时就访问不到了。dist里的文件,也是打包到asar里面的 |
建议你解压 其实如果文件路径控制的好,开发和构建可以复用相同路径。不用纠结是否要 copy 到 dist 文件夹中,比如你建一个 static 文件夹,然后配置在 electron-builder.json5 的 files 选项中,构建后路径是不会发生变化的,原样 copy 到 app.asar/static 中。 |
如果我在electron文件夹里还有其它的js文件,我在index.js里面使用了,比如utils.js,或者xxx.js文件,打包时,怎么配置把这些文件也打包到dist文件夹里?
现在好像只能配置打包index.js和preload.js文件
The text was updated successfully, but these errors were encountered: