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

Commit

Permalink
fix(mapping): Fix mapping again in editors
Browse files Browse the repository at this point in the history
Put back the original fix introduced in 0da3f7d. During the refactor of the
mapping function, this code disappeared.
Would be great to have some tests testing this specific case as well.
  • Loading branch information
Tommy Leunen committed Jul 10, 2016
1 parent 380a986 commit 3b3bc98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ function getMappingFromBabel(start) {
const c = findBabelConfig(start);
if (c && c.config && Array.isArray(c.config.plugins)) {
const pluginConfig = c.config.plugins.find(p => p[0] === 'module-alias');
// The src path inside babelrc are from the root so we have
// to change the working directory for the "current file directory"
// in order for the mapping in the editor (atom/sublime) to work properly
process.chdir(path.dirname(c.file));
return pluginConfig[1];
}

Expand Down

0 comments on commit 3b3bc98

Please sign in to comment.