File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,18 @@ const Module = require('module');
5
5
// Clear Node's global search paths.
6
6
Module . globalPaths . length = 0 ;
7
7
8
+ // We do not want to allow use of the VM module in the renderer process as
9
+ // it conflicts with Blink's V8::Context internal logic.
10
+ if ( process . type === 'renderer' ) {
11
+ const _load = Module . _load ;
12
+ Module . _load = function ( request : string ) {
13
+ if ( request === 'vm' ) {
14
+ console . warn ( 'The vm module of Node.js is deprecated in the renderer process and will be removed.' ) ;
15
+ }
16
+ return _load . apply ( this , arguments ) ;
17
+ } ;
18
+ }
19
+
8
20
// Prevent Node from adding paths outside this app to search paths.
9
21
const resourcesPathWithTrailingSlash = process . resourcesPath + path . sep ;
10
22
const originalNodeModulePaths = Module . _nodeModulePaths ;
You can’t perform that action at this time.
0 commit comments