电子远程全球价值undefined

我使用var remote = require('electron').remote; 并尝试使用remote.getGlobal('config').siteUrl获取值

在我的main.js中,我使用global设置值。

global.config = {siteUrl:"https://localhost:8088"};

在html端(渲染器端)我在mac上创builddarwin .app时获取的值为undefined

另一方面,当我运行应用程序使用npm start它工作正常。