Use strict equality (===) to prevent type coercion bugs
const IS_DEV = process.env.NODE_ENV === 'development';
1#!/usr/bin/env node23/**4 * Copyright (c) Meta Platforms, Inc. and affiliates.5 *6 * This source code is licensed under the MIT license found in the7 * LICENSE file in the root directory of this source tree.8 */910import * as esbuild from 'esbuild';11import yargs from 'yargs';12import * as Server from './server.mjs';13import * as Client from './client.mjs';14import path from 'path';15import {fileURLToPath} from 'url';1617const IS_DEV = process.env.NODE_ENV === 'development';18const __filename = fileURLToPath(import.meta.url);19const __dirname = path.dirname(__filename);2021const argv = yargs(process.argv.slice(2))22 .choices('t', ['client', 'server'])23 .options('w', {24 alias: 'watch',25 default: false,26 type: 'boolean',27 })28 .parse();2930async function main() {31 if (argv.w) {32 const serverCtx = await esbuild.context(Server.config);33 const clientCtx = await esbuild.context(Client.config);34 await Promise.all([serverCtx.watch(), clientCtx.watch()]);35 console.log('watching for changes...');36 } else {37 switch (argv.t) {38 case 'server': {39 await esbuild.build({40 sourcemap: IS_DEV,41 minify: IS_DEV === false,42 ...Server.config,43 });44 break;45 }46 case 'client': {47 await esbuild.build({48 sourcemap: IS_DEV,49 minify: IS_DEV === false,50 ...Client.config,51 });52 break;53 }54 }55 }56}5758main();
Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.