正在显示
2 个修改的文件
包含
10 行增加
和
12 行删除
| ... | @@ -16,7 +16,7 @@ let electronProcess = null | ... | @@ -16,7 +16,7 @@ let electronProcess = null |
| 16 | let manualRestart = false | 16 | let manualRestart = false |
| 17 | let hotMiddleware | 17 | let hotMiddleware |
| 18 | 18 | ||
| 19 | -function logStats (proc, data) { | 19 | +function logStats(proc, data) { |
| 20 | let log = '' | 20 | let log = '' |
| 21 | 21 | ||
| 22 | log += chalk.yellow.bold(`┏ ${proc} Process ${new Array((19 - proc.length) + 1).join('-')}`) | 22 | log += chalk.yellow.bold(`┏ ${proc} Process ${new Array((19 - proc.length) + 1).join('-')}`) |
| ... | @@ -34,11 +34,9 @@ function logStats (proc, data) { | ... | @@ -34,11 +34,9 @@ function logStats (proc, data) { |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | log += '\n' + chalk.yellow.bold(`┗ ${new Array(28 + 1).join('-')}`) + '\n' | 36 | log += '\n' + chalk.yellow.bold(`┗ ${new Array(28 + 1).join('-')}`) + '\n' |
| 37 | - | ||
| 38 | - console.log(log) | ||
| 39 | } | 37 | } |
| 40 | 38 | ||
| 41 | -function startRenderer () { | 39 | +function startRenderer() { |
| 42 | return new Promise((resolve, reject) => { | 40 | return new Promise((resolve, reject) => { |
| 43 | rendererConfig.entry.renderer = [path.join(__dirname, 'dev-client')].concat(rendererConfig.entry.renderer) | 41 | rendererConfig.entry.renderer = [path.join(__dirname, 'dev-client')].concat(rendererConfig.entry.renderer) |
| 44 | rendererConfig.mode = 'development' | 42 | rendererConfig.mode = 'development' |
| ... | @@ -64,7 +62,7 @@ function startRenderer () { | ... | @@ -64,7 +62,7 @@ function startRenderer () { |
| 64 | { | 62 | { |
| 65 | contentBase: path.join(__dirname, '../'), | 63 | contentBase: path.join(__dirname, '../'), |
| 66 | quiet: true, | 64 | quiet: true, |
| 67 | - before (app, ctx) { | 65 | + before(app, ctx) { |
| 68 | app.use(hotMiddleware) | 66 | app.use(hotMiddleware) |
| 69 | ctx.middleware.waitUntilValid(() => { | 67 | ctx.middleware.waitUntilValid(() => { |
| 70 | resolve() | 68 | resolve() |
| ... | @@ -77,7 +75,7 @@ function startRenderer () { | ... | @@ -77,7 +75,7 @@ function startRenderer () { |
| 77 | }) | 75 | }) |
| 78 | } | 76 | } |
| 79 | 77 | ||
| 80 | -function startMain () { | 78 | +function startMain() { |
| 81 | return new Promise((resolve, reject) => { | 79 | return new Promise((resolve, reject) => { |
| 82 | mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main) | 80 | mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main) |
| 83 | mainConfig.mode = 'development' | 81 | mainConfig.mode = 'development' |
| ... | @@ -113,7 +111,7 @@ function startMain () { | ... | @@ -113,7 +111,7 @@ function startMain () { |
| 113 | }) | 111 | }) |
| 114 | } | 112 | } |
| 115 | 113 | ||
| 116 | -function startElectron () { | 114 | +function startElectron() { |
| 117 | var args = [ | 115 | var args = [ |
| 118 | '--inspect=5858', | 116 | '--inspect=5858', |
| 119 | path.join(__dirname, '../dist/electron/main.js') | 117 | path.join(__dirname, '../dist/electron/main.js') |
| ... | @@ -127,7 +125,7 @@ function startElectron () { | ... | @@ -127,7 +125,7 @@ function startElectron () { |
| 127 | } | 125 | } |
| 128 | 126 | ||
| 129 | electronProcess = spawn(electron, args) | 127 | electronProcess = spawn(electron, args) |
| 130 | - | 128 | + |
| 131 | electronProcess.stdout.on('data', data => { | 129 | electronProcess.stdout.on('data', data => { |
| 132 | electronLog(data, 'blue') | 130 | electronLog(data, 'blue') |
| 133 | }) | 131 | }) |
| ... | @@ -140,7 +138,7 @@ function startElectron () { | ... | @@ -140,7 +138,7 @@ function startElectron () { |
| 140 | }) | 138 | }) |
| 141 | } | 139 | } |
| 142 | 140 | ||
| 143 | -function electronLog (data, color) { | 141 | +function electronLog(data, color) { |
| 144 | let log = '' | 142 | let log = '' |
| 145 | data = data.toString().split(/\r?\n/) | 143 | data = data.toString().split(/\r?\n/) |
| 146 | data.forEach(line => { | 144 | data.forEach(line => { |
| ... | @@ -157,7 +155,7 @@ function electronLog (data, color) { | ... | @@ -157,7 +155,7 @@ function electronLog (data, color) { |
| 157 | } | 155 | } |
| 158 | } | 156 | } |
| 159 | 157 | ||
| 160 | -function greeting () { | 158 | +function greeting() { |
| 161 | const cols = process.stdout.columns | 159 | const cols = process.stdout.columns |
| 162 | let text = '' | 160 | let text = '' |
| 163 | 161 | ||
| ... | @@ -175,7 +173,7 @@ function greeting () { | ... | @@ -175,7 +173,7 @@ function greeting () { |
| 175 | console.log(chalk.blue(' getting ready...') + '\n') | 173 | console.log(chalk.blue(' getting ready...') + '\n') |
| 176 | } | 174 | } |
| 177 | 175 | ||
| 178 | -function init () { | 176 | +function init() { |
| 179 | greeting() | 177 | greeting() |
| 180 | 178 | ||
| 181 | Promise.all([startRenderer(), startMain()]) | 179 | Promise.all([startRenderer(), startMain()]) | ... | ... |
| ... | @@ -31,7 +31,7 @@ function createWindow () { | ... | @@ -31,7 +31,7 @@ function createWindow () { |
| 31 | width: 1000, | 31 | width: 1000, |
| 32 | show: false, | 32 | show: false, |
| 33 | backgroundColor: '#fffff', | 33 | backgroundColor: '#fffff', |
| 34 | - titleBarStyle: 'hidden', | 34 | + titleBarStyle: 'hidden' |
| 35 | // 隐藏边框 | 35 | // 隐藏边框 |
| 36 | // frame: false, | 36 | // frame: false, |
| 37 | }) | 37 | }) | ... | ... |
-
请 注册 或 登录 后发表评论