diff --git a/lib/browser/init.ts b/lib/browser/init.ts index 43634a794a34..762fa6c70e7c 100644 --- a/lib/browser/init.ts +++ b/lib/browser/init.ts @@ -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)