[英]How to Successfully and Efficiently Install SQLite3 in Electron-Forge?
[英]How to change electron-forge default port?
我在他們的網站\/文檔中的任何地方都找不到關於此的參考。 我需要將其更改為另一個端口,目前它卡在 3000 中。
這是我使用
electron-forge<\/code>創建電子項目的方法
yarn create electron-app my-new-app --template=typescript
我剛開始使用electron-forge 並遇到了同樣的問題,而且electron/webpack 似乎忽略了我的devServer.port
值。
在找到這個電子鍛造配置的文檔后,我意識到devServer.port
可能被電子鍛造覆蓋了,並且配置的值是在 package.json 中設置的。 這是我的:
{
"name": "my-project",
// ...
"config": {
"forge": {
"packagerConfig": {},
"makers": [
// ...
],
"plugins": [
[
"@electron-forge/plugin-webpack",
{
"mainConfig": "./webpack.main.config.js",
"renderer": {
"config": "./webpack.renderer.config.js",
"entryPoints": [
{
"html": "./src/index.html",
"js": "./src/renderer.js",
"name": "main_window"
}
]
},
// the secret sauce:
"port": 3001,
"loggerPort": 9001
}
]
]
}
}
}
作為對這個問題的更新,我無法復制最受好評的答案,並最終通過在另一篇文章中實現此答案,以稍微不同的方法更改了默認端口。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.