Commit 4790f049 authored by antoor's avatar antoor

Optimal configuration loading scheme

优化配置加载方案
parent 20748590
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
'use strict'; 'use strict';
// 读取package.json信息 // 读取package.json信息
const info = JSON.parse( const info = require('../package');
require('fs').readFileSync(require('path').join(__dirname, '../package.json'))
);
class Menubar { class Menubar {
......
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
// 程序入口 // 程序入口
// ------- // -------
// create: 2015/12/20 // create: 2015/12/20
// update: 2016/01/20 // update: 2016/04/02
// //
'use strict'; 'use strict';
const fs = global.require('fs');
const path = global.require('path');
const electron = global.require('electron'); const electron = global.require('electron');
const remote = electron.remote; const remote = electron.remote;
const ipcRenderer = electron.ipcRenderer; const ipcRenderer = electron.ipcRenderer;
...@@ -59,7 +57,7 @@ ipcRenderer.send('aproxy', { ...@@ -59,7 +57,7 @@ ipcRenderer.send('aproxy', {
antSword['ipcRenderer'] = ipcRenderer; antSword['ipcRenderer'] = ipcRenderer;
antSword['CacheManager'] = CacheManager; antSword['CacheManager'] = CacheManager;
antSword['menubar'] = new Menubar(); antSword['menubar'] = new Menubar();
antSword['package'] = JSON.parse(fs.readFileSync(path.join(global.__dirname, '../package.json'))); antSword['package'] = global.require('../package'));
// 加载模块列表 // 加载模块列表
// antSword['tabbar'] = new dhtmlXTabBar(document.getElementById('container')); // antSword['tabbar'] = new dhtmlXTabBar(document.getElementById('container'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment