From bda2ee6647db025a4917fee1a1004a81286b39a4 Mon Sep 17 00:00:00 2001 From: Michael Ferris Date: Sat, 13 Jun 2015 13:40:36 -0400 Subject: [PATCH] Remove links to babel internal api and only use what we really need. --- tools/buildBabel.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/buildBabel.js b/tools/buildBabel.js index 7811d21bb4..87a79f8b85 100644 --- a/tools/buildBabel.js +++ b/tools/buildBabel.js @@ -1,13 +1,12 @@ import { transform } from 'babel-core'; -import resolveRc from 'babel-core/lib/babel/tools/resolve-rc'; -import * as babelUtil from 'babel-core/lib/babel/util'; import glob from 'glob'; import fs from 'fs'; import path from 'path'; import outputFileSync from 'output-file-sync'; export function buildContent(content, filename, destination, babelOptions={}) { - const result = transform(content, resolveRc(filename, babelOptions)); + babelOptions.filename = filename; + const result = transform(content, babelOptions); outputFileSync(destination, result.code, {encoding: 'utf8'}); } @@ -19,11 +18,9 @@ console.warn('You can read more about it at https://github.com/react-bootstrap/r ${content}`; } - if(babelUtil.canCompile(filename)) { - // Get file basename without the extension (in case not .js) - let outputName = path.basename(filename, path.extname(filename)); - // append the file basename with extension .js - let outputPath = path.join(destination, outputName + '.js'); + // We only have .js files that we need to build + if(path.extname(filename) === '.js') { + const outputPath = path.join(destination, path.basename(filename)); // console.log('%s => %s', filename, outputPath); buildContent(content, filename, outputPath, babelOptions); }