Fixing windows build (#849)

Co-authored-by: Ingvar Stepanyan <rreverser@google.com>
This commit is contained in:
Jake Archibald
2020-11-19 15:03:51 +00:00
committed by GitHub
parent 6ebf94d1b6
commit 30b628c1b9
6 changed files with 15 additions and 17 deletions

View File

@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { posix as pathUtils } from 'path';
import { posix as pathUtils, isAbsolute } from 'path';
export default function resolveDirs(paths) {
const pathBaseDir = paths.map((path) => [
@@ -30,6 +30,7 @@ export default function resolveDirs(paths) {
if (!resolveResult) {
throw new Error(`Couldn't find ${'./' + id}`);
}
if (isAbsolute(resolveResult.id)) return resolveResult.id;
return pathUtils.resolve(resolveResult.id);
},
};