(done)
| 111 | } |
| 112 | |
| 113 | _prodWorker(done) { |
| 114 | const callback = once(done); |
| 115 | if (!this._worker) { |
| 116 | process.nextTick(() => callback('worker initialization failed')); |
| 117 | return; |
| 118 | } |
| 119 | const timeoutId = setTimeout(() => { |
| 120 | this.stopWorker(); |
| 121 | console.log( |
| 122 | 'The process was timed out. Try to increase it by providing --timeout [number] option' |
| 123 | .yellow, |
| 124 | ); |
| 125 | callback('worker timed out'); |
| 126 | }, this.timeout); |
| 127 | this._onWorkerReady(() => { |
| 128 | clearTimeout(timeoutId); |
| 129 | // send a message to the worker to start bundling js |
| 130 | this._worker.send('production'); |
| 131 | this._worker.on('message', (message) => { |
| 132 | if (message === 'done') { |
| 133 | this._worker.kill(); |
| 134 | callback(); |
| 135 | } |
| 136 | }); |
| 137 | }); |
| 138 | this._worker.on('close', () => { |
| 139 | callback('worker terminated'); |
| 140 | clearTimeout(timeoutId); |
| 141 | }); |
| 142 | } |
| 143 | } |
| 144 | export default BuildConfigManager; |
nothing calls this directly
no test coverage detected