Q:

Can I have 2 babelrc files in one project?

I'm trying to add react to a very large solution, but one component on the site uses preact. My current  .bablerc is 
{
  "presets": ["env"],
  "ignore": [
      "**/what-input.js",
      "**/HostedPCIAdapter.js",
      "InstantPreview/**/*.js",
      "Wishlist/**/*.js"
    ],
  "plugins": [
    "transform-object-rest-spread",
    "transform-react-jsx"
  ]
}

Original .baberc looked like this:
{
"sourceMaps": true,
"presets": [],
"plugins": [
[
    "transform-react-jsx",
{
    "pragma": "preact.h"
} 
],
"transform-object-assign",
[
    "transform-es2015-classes",
    {
        "loose": true 
    }
],
"transform-es2015-arrow-functions",
"transform-es2015-block-scoping",
"transform-es2015-template-literals"
]

}

So can I add pragma back for just the wishlist feature? Any help would be appreciated. I'm using gulp as a taskrunner and webpack to build my assets. 

A:

Babel files can be nested in sub-directories with unique settings which is pretty cool stuff. 
So if you have a folder structure like this:
app
    reactCode
        .babelrc
        index.js
    preactCode
        .babelrc
        index.js

You can add a separate .babelrc file for branch. 
I don't think it's ideal but if you're working with a large monolithic solution that has lots of different frameworks and requirements it certainly can fix a lot of bugs and QA work. 

