Skip to content

Commit

Permalink
Use resolve instead of require in resolveConfigurationPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
janslow committed Apr 26, 2016
1 parent 19d6068 commit ac0f51e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import * as fs from "fs";
import * as path from "path";
import * as findup from "findup-sync";
import * as pathIsAbsolute from "path-is-absolute";
import * as resolve from "resolve";

import {arrayify, objectify, stripComments} from "./utils";

Expand Down Expand Up @@ -173,7 +174,7 @@ function resolveConfigurationPath(relativeFilePath: string, relativeTo?: string)
resolvedPath = getRelativePath(relativeFilePath, relativeTo);
} else {
try {
resolvedPath = require.resolve(relativeFilePath);
resolvedPath = resolve.sync(relativeFilePath, { basedir: relativeTo });
} catch (err) {
throw new Error(`Invalid "extends" configuration value - could not require "${relativeFilePath}". ` +
"Review the Node lookup algorithm (https://nodejs.org/api/modules.html#modules_all_together) " +
Expand Down

0 comments on commit ac0f51e

Please sign in to comment.