electron - 电子没有得到命令行参数
问题描述
尝试在 Electron.js 中为 localhost dev 创建一个选项(我有两种类型的 config.inis 用于本地和非本地选项)并且想从命令行运行命令,例如 yarn dev --scope=local
但是,我无法让 process.argv 工作,argv 数组仅显示:
['C:\xxxx\xxxxxx\xxxxxx\xxxxxx\node_modules\electron\dist\electron.exe', '-r', './internals/scripts/BabelRegister', './app/main.dev.ts' ]
这里它说获取 argv 取决于进程类型,但我的是主要的。将命令行参数传递给电子可执行文件(安装已打包的应用程序后)
非常感谢帮助!
解决方案
推荐阅读
- python - 如何使用列表推导根据字长过滤字符串列表?
- c++ - “退出,分段错误”与链表
- oracle - 编写查询以显示学生“David”的学生 ID 和地址。注意:学生姓名可以在任何情况下
- javascript - 用于 div 的 JQuery Live 过滤器
- c++ - C++ 利用有状态闭包的属性?
- javascript - 状态更改后正确重新触发功能(React)
- css - 如何在svg中剪切图像
- android - 如何从改造中解析android中的Json响应
- python - 当我用 pyautogui 编写文件名时,文件名无效
- algorithmic-trading - Tradingview 提醒,只需通过 mt4 进行交易