Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Commit

Permalink
Fix path and es6 arrow function for return
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Le authored and Christian Le committed Feb 21, 2017
1 parent 4dca9f9 commit 17f06b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ if (babelRootImport.default) {
function getConfigFromBabel(start, babelrc = '.babelrc') {
if (start === '/') return [];

const packageJSONPath = path.join(start, babelrc);
const packageJSONPath = path.join(start, 'package.json');
const packageJSON = require(packageJSONPath);
const babelConfig = packageJSON.babel;
if (babelConfig) {
const pluginConfig = babelConfig.plugins.find(p => {
const pluginConfig = babelConfig.plugins.find(p => (
p[0] === 'babel-root-import'
});
));
process.chdir(path.dirname(packageJSONPath));
return pluginConfig[1];
}
Expand Down

0 comments on commit 17f06b6

Please sign in to comment.