Closed NO-MAP closed 11 months ago
I started a child_process in my extension process:
const { fork } = require('child_process'); const childProcess = fork(scriptPath);
In my child_process script, I required the vscode module:
vscode
const vscode = require('vscode'); const document = vscode.window.activeTextEditor?.document;
Then I encountered this error:
Cannot find module 'vscode'
I understand that vscode might be a special module. In the webpack.config.js file, the vscode module is marked as externals:
webpack.config.js
externals: ['vscode']
Is there any way to use the vscode module in my extension child_process?
No, it's not a node module, but more like a global. It's only available in the extension host process.
I started a child_process in my extension process:
In my child_process script, I required the
vscode
module:Then I encountered this error:
I understand that
vscode
might be a special module. In thewebpack.config.js
file, thevscode
module is marked as externals:Is there any way to use the
vscode
module in my extension child_process?