refactor: lazy load V8 module in browser/init (#18575)
This commit is contained in:
parent
bc527f6b51
commit
449d2752f2
1 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,6 @@ import { Buffer } from 'buffer'
|
|||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
import * as util from 'util'
|
||||
import * as v8 from 'v8'
|
||||
|
||||
const Module = require('module')
|
||||
|
||||
|
@ -141,9 +140,10 @@ if (packageJson.desktopName != null) {
|
|||
app.setDesktopName(`${app.name}.desktop`)
|
||||
}
|
||||
|
||||
// Set v8 flags
|
||||
// Set v8 flags, delibrately lazy load so that apps that do not use this
|
||||
// feature do not pay the price
|
||||
if (packageJson.v8Flags != null) {
|
||||
v8.setFlagsFromString(packageJson.v8Flags)
|
||||
require('v8').setFlagsFromString(packageJson.v8Flags)
|
||||
}
|
||||
|
||||
app._setDefaultAppPaths(packagePath)
|
||||
|
|
Loading…
Reference in a new issue