Skip to content

`--watch` fix and BABEL_WATCH_NODE_OPTIONS

Compare
Choose a tag to compare
@STRML STRML released this 05 Feb 20:10
· 26 commits to master since this release

This release fixes two issues:

  • #98: There wasn't a good way to reliably pass NODE_OPTIONS to the child. If you use NODE_OPTIONS, it will apply both to the babel-watch parent instance and to the child (your code), causing issues with options like --inspect. Therefore, I have added BABEL_WATCH_NODE_OPTIONS, which will be ignored by the parent and passed on to the child like you'd expect. In 99.9% of cases, this is what you want.
  • #120: It appears the --watch option (i.e. babel-watch --watch interfaces/ app.js) didn't actually do anything very useful. It would add the folder to be watched by chokidar, but because it wasn't required by the application, babel-watch would simply execute no action on a modification. This is not intended so that logic has been removed, and you can now watch arbitrary folders and restart on them.
    • Just be sure to add to --extensions if the files you're watching don't end in .js.
    • If you need to exclude a path, use --exclude. Be careful not to use --ignore, which is instead passed to babel. In a later release I will rename this because it's confusing.
    • See the README for all options.