UNPKG

@lingui/core

Version:

Internationalization (i18n) tools for JavaScript

26 lines (21 loc) 975 B
import babelPluginMacros from "babel-plugin-macros" import { macro } from "@lingui/babel-plugin-lingui-macro/macro" const { createMacro } = babelPluginMacros export default createMacro(macro, { configName: "lingui", }) // the following shims for the case when this import used by nodejs code without transpilation function printError() { throw new Error( `The macro you imported from "@lingui/core/macro" is being executed outside the context of compilation. \n` + `This indicates that you don't configured correctly one of the "babel-plugin-macros" / "@lingui/swc-plugin" / "babel-plugin-lingui-macro" \n` + "Additionally, dynamic imports — e.g., `await import('@lingui/core/macro')` — are not supported.", ) } export const t = printError export const msg = printError export const ph = printError export const defineMessage = printError export const plural = printError export const select = printError export const selectOrdinal = printError