refactor: lazy load child_process in the crash-reporter module (#18574)

This module is on the hot load path and we don't need cp till later
This commit is contained in:
Samuel Attard 2019-06-03 11:48:23 -07:00 committed by GitHub
parent 477b09db3e
commit 0ee2f8a64a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,6 @@
'use strict'
const { app } = require('electron')
const cp = require('child_process')
const path = require('path')
const getTempDirectory = function () {
@ -30,7 +29,7 @@ exports.crashReporterInit = function (options) {
'--v=1'
]
const crashServiceProcess = cp.spawn(process.helperExecPath, args, {
const crashServiceProcess = require('child_process').spawn(process.helperExecPath, args, {
env,
detached: true
})