Skip to content

Commit

Permalink
fix: 'compile --watch' not watching for correct file based on format (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
luludan authored Jun 17, 2021
1 parent 5cd464d commit ab68c06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/cli/src/lingui-compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { getConfig, LinguiConfig } from "@lingui/conf"
import { getCatalogs } from "./api/catalog"
import { createCompiledCatalog } from "./api/compile"
import { helpRun } from "./api/help"
import { getFormat } from "./api";

const noMessages: (catalogs: Object[]) => boolean = R.pipe(
R.map(R.isEmpty),
Expand Down Expand Up @@ -174,10 +175,11 @@ if (require.main === module) {

const catalogs = getCatalogs(config);
let paths = [];
const catalogExtension = getFormat(config.format).catalogExtension;

config.locales.forEach((locale) => {
catalogs.forEach((catalog) => {
paths.push(`${catalog.path.replace(LOCALE, locale).replace(NAME, "*")}.${config.format}`)
paths.push(`${catalog.path.replace(LOCALE, locale).replace(NAME, "*")}${catalogExtension}`)
})
})

Expand Down

1 comment on commit ab68c06

@vercel
Copy link

@vercel vercel bot commented on ab68c06 Jun 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.