guybedford / chomp

'JS Make' - parallel task runner for the frontend ecosystem with a JS extension system.
https://chompbuild.com
Apache License 2.0
143 stars 7 forks source link

Engines #4

Closed guybedford closed 2 years ago

guybedford commented 2 years ago

It would be useful to have an engines field that can permit different runtime engines, with the default effectively being Bash / Powershell.

For example a Node.js engine would allow directly writing Node.js code in tasks:

[[task]]
  target = "copy-file.js"
  deps = ["file.js"]
  engine = "nodejs"
  run = """
    import { writeFileSync } from 'fs';
    writeFileSync('./file.js', readFileSync(process.env.DEP));
  """
guybedford commented 2 years ago

Implemented in https://github.com/guybedford/chomp/commit/f79fc2462b8e24f09c81274c01c2ed95d64bd6a0 as engine = "node".