Back to Moon

Scripts

website/docs/__partials__/migrate/bun/scripts.mdx

2.2.4751 B
Original Source

Bun provides a built-in script runner through the bun run command. While Bun scripts are great, they're not as efficient as moon. They do not support granular inputs, smart hashing, incremental caching, and all the other performance benefits that moon provides.

With that being said, you do not have to migrate away from Bun scripts. Instead, you can simply run them from within moon tasks. This gives you the best of both worlds.

yaml
language: 'typescript'

tasks:
  analyze:
    command: 'bun run analyze'
    inputs:
      - '@globs(sources)'
      - '@globs(tests)'

When Bun scripts are ran through moon tasks, the current working directory is set to the project root.