Skip to content

Commit

Permalink
fix(@formatjs/cli): fix formatter path resolution, fix #1969
Browse files Browse the repository at this point in the history
  • Loading branch information
longlho committed Aug 14, 2020
1 parent cf9b570 commit d6ec6ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/formatters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as smartling from './smartling';
import * as simple from './simple';
import * as lokalise from './lokalise';
import * as crowdin from './crowdin';

import {resolve} from 'path';
export async function resolveBuiltinFormatter(format?: string) {
if (!format) {
return defaultFormatter;
Expand All @@ -22,7 +22,7 @@ export async function resolveBuiltinFormatter(format?: string) {
return crowdin;
}
try {
return import(format);
return import(resolve(process.cwd(), format));
} catch (e) {
console.error(`Cannot resolve formatter ${format}`);
throw e;
Expand Down

0 comments on commit d6ec6ca

Please sign in to comment.