interlockjs/interlock

Per-file babel config

divmain opened this issue · 1 comments

If babelConfig value is not supplied via config file or command-line flag, the babel config should be loaded on a per-file basis. This means that, whenever a file is about to be transformed (and possibly before parsing), we should:

  • check for a .babelrc file in the file's ancestor path,
  • fallback to package.json babel config, and finally
  • assume no babel transformation otherwise.

Note: it should be possible to accomplish this by passing a filename option to babelCore.transformFromAst. It should traverse the directory hierarchy to find the correct .babelrc or package.json and merge it into the provided config.