esbuild 758 B

1234567891011121314
  1. #!/usr/bin/env node
  2. // Unfortunately even though npm shims "bin" commands on Windows with auto-
  3. // generated forwarding scripts, it doesn't strip the ".exe" from the file name
  4. // first. So it's possible to publish executables via npm on all platforms
  5. // except Windows. I consider this a npm bug.
  6. //
  7. // My workaround is to add this script as another layer of indirection. It'll
  8. // be slower because node has to boot up just to shell out to the actual exe,
  9. // but Windows is somewhat of a second-class platform to npm so it's the best
  10. // I can do I think.
  11. const esbuild_exe = require.resolve('esbuild-windows-64/esbuild.exe');
  12. const child_process = require('child_process');
  13. child_process.spawnSync(esbuild_exe, process.argv.slice(2), { stdio: 'inherit' });