mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-31 20:16:36 +08:00
fix: 打包 BUG
This commit is contained in:
parent
dc758b0521
commit
a6dd5d1ad7
@ -55,6 +55,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
- main 进程中暂时无法用 require,打包后会导致模块找不到 `21-02-18`
|
||||||
|
|
||||||
## 总结
|
## 总结
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* electron 主文件
|
* electron 主文件
|
||||||
*/
|
*/
|
||||||
require('dotenv').config({ path: join(__dirname, '../../.env') })
|
|
||||||
|
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { app, BrowserWindow } from 'electron'
|
import { app, BrowserWindow } from 'electron'
|
||||||
|
import dotenv from 'dotenv'
|
||||||
|
|
||||||
|
dotenv.config({ path: join(__dirname, '../../.env') })
|
||||||
|
|
||||||
let win: BrowserWindow
|
let win: BrowserWindow
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import { cjs2esm } from './script/utils'
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
root: join(__dirname, 'src/render'),
|
root: join(__dirname, 'src/render'),
|
||||||
|
base: './', // index.html 中静态资源加载位置
|
||||||
server: {
|
server: {
|
||||||
port: +process.env.PORT,
|
port: +process.env.PORT,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user