Skip to content

Commit 6e60d2b

Browse files
committed
Merge branch 'master' into v0.24-rc
Conflicts: tools/buildBabel.js
2 parents 36358d6 + 6bcddb7 commit 6e60d2b

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tools/buildBabel.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
import { transform } from 'babel-core';
2-
import resolveRc from 'babel-core/lib/babel/tools/resolve-rc';
3-
import * as babelUtil from 'babel-core/lib/babel/util';
42
import glob from 'glob';
53
import fs from 'fs';
64
import path from 'path';
75
import outputFileSync from 'output-file-sync';
86

97
export function buildContent(content, filename, destination, babelOptions={}) {
10-
const result = transform(content, resolveRc(filename, babelOptions));
8+
babelOptions.filename = filename;
9+
const result = transform(content, babelOptions);
1110
outputFileSync(destination, result.code, {encoding: 'utf8'});
1211
}
1312

1413
export function buildFile(filename, destination, babelOptions={}) {
1514
const content = fs.readFileSync(filename, {encoding: 'utf8'});
16-
if(babelUtil.canCompile(filename)) {
17-
// Get file basename without the extension (in case not .js)
18-
let outputName = path.basename(filename, path.extname(filename));
19-
// append the file basename with extension .js
20-
let outputPath = path.join(destination, outputName + '.js');
15+
// We only have .js files that we need to build
16+
if(path.extname(filename) === '.js') {
17+
const outputPath = path.join(destination, path.basename(filename));
2118
// console.log('%s => %s', filename, outputPath);
2219
buildContent(content, filename, outputPath, babelOptions);
2320
}

0 commit comments

Comments
 (0)