diff --git a/transformer.js b/transformer.js index 0a972982..eda81467 100644 --- a/transformer.js +++ b/transformer.js @@ -37,11 +37,6 @@ const getBabelRC = (function() { // Let's look for the .babelrc in the first project root. // In the future let's look into adding a command line option to specify // this location. - // - // NOTE: we're not reading the project's .babelrc here. We leave it up to - // Babel to do that automatically and apply the transforms accordingly - // (which works because we pass in `filename` and `sourceFilename` to - // Babel when we transform). let projectBabelRCPath; if (projectRoots && projectRoots.length > 0) { projectBabelRCPath = path.resolve(projectRoots[0], '.babelrc'); @@ -58,6 +53,9 @@ const getBabelRC = (function() { // Require the babel-preset's listed in the default babel config babelRC.presets = babelRC.presets.map((preset) => require('babel-preset-' + preset)); babelRC.plugins = resolvePlugins(babelRC.plugins); + } else { + // if we find a .babelrc file we tell babel to use it + babelRC.extends = projectBabelRCPath; } return babelRC;