Я нашел способ заставить это работать, и я решил записать это здесь для блага других.
Мне пришлось залатать плагин взломом, который, безусловно, можно сделать более изящным (чего я постараюсь добиться и представить PR).
В nativeScriptCli.ts я изменил следующие методы, добавив переменную окружения NODE_OPTIONS
к каждому порождению Node
:
public executeSync(args: string[], cwd: string): string {
args.unshift('--analyticsClient', 'VSCode');
const command: string = `${this._path} ${args.join(' ')}`;
let env = process.env;
env["NODE_OPTIONS"] = "--max-old-space-size=4096";
this._logger.log(`[NativeScriptCli] execute: ${command}`);
return execSync(command, { encoding: 'utf8', cwd, shell: this._shellPath, env: env }).toString().trim();
}
public execute(args: string[], cwd: string): ChildProcess {
args.unshift('--analyticsClient', 'VSCode');
const command: string = `${this._path} ${args.join(' ')}`;
this._logger.log(`[NativeScriptCli] execute: ${command}`);
let env = process.env;
env["NODE_OPTIONS"] = "--max-old-space-size=4096";
const options = { cwd, shell: this._shellPath, env: env };
const child: ChildProcess = spawn(this._path, args, options);
child.stdout.setEncoding('utf8');
child.stderr.setEncoding('utf8');
return child;
}
После установки этой взломанной версии на моем Mac, приложение теперь успешно встраивается в VS Code
.