JezK
Edit File: node.js.map
{"version":3,"file":"node.js","names":["setFlags","commander","description","usage","option","hasWrapper","args","run","config","reporter","flags","pnpPath","lockfileFolder","PNP_FILENAME","nodeOptions","process","env","NODE_OPTIONS","fs","exists","child","spawn","NODE_BIN_PATH","stdio","cwd","into"],"sourceRoot":"../../../src","sources":["cli/commands/node.js"],"sourcesContent":["// @flow\n\nimport type Config from '../../config.js';\nimport type {Reporter} from '../../reporters/index.js';\nimport * as child from '../../util/child.js';\nimport * as fs from '../../util/fs.js';\nimport {NODE_BIN_PATH, PNP_FILENAME} from '../../constants';\n\nexport function setFlags(commander: Object) {\n commander.description(\n 'Runs Node with the same version that the one used by Yarn itself, and by default from the project root',\n );\n commander.usage('node [--into PATH] [... args]');\n commander.option('--into <path>', 'Sets the cwd to the specified location');\n}\n\nexport function hasWrapper(commander: Object, args: Array<string>): boolean {\n return true;\n}\n\nexport async function run(config: Config, reporter: Reporter, commander: Object, flags: Object, args: Array<string>): Promise<void> {\n const pnpPath = `${config.lockfileFolder}/${PNP_FILENAME}`;\n\n let nodeOptions = process.env.NODE_OPTIONS || '';\n if (await fs.exists(pnpPath)) {\n nodeOptions = `--require ${pnpPath} ${nodeOptions}`;\n }\n\n try {\n await child.spawn(NODE_BIN_PATH, args, {\n stdio: 'inherit',\n cwd: flags.into || config.cwd,\n env: {...process.env, NODE_OPTIONS: nodeOptions},\n });\n } catch (err) {\n throw err;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA4D;AAAA;AAAA;AAAA;AAErD,SAASA,QAAQ,CAACC,SAAiB,EAAE;EAC1CA,SAAS,CAACC,WAAW,CACnB,wGAAwG,CACzG;EACDD,SAAS,CAACE,KAAK,CAAC,+BAA+B,CAAC;EAChDF,SAAS,CAACG,MAA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