@ices/react-locale
Version:
React components for locale
45 lines (40 loc) • 1.62 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
function getModuleCode({ module, esModule, resourcePath, }) {
const runtime = JSON.stringify('@ices/react-locale');
const request = JSON.stringify(module);
return esModule
? `
/** ${resourcePath} **/
import definitions from ${request}
import { withDefinitionsComponent, withDefinitionsHook, withDefinitionsContextHook } from ${runtime}
var Trans = withDefinitionsComponent(definitions)
var useTrans = withDefinitionsHook(definitions)
var useContextTrans = withDefinitionsContextHook(definitions)
export { useTrans as default, definitions, Trans, useTrans, useContextTrans }
`
: `
/** ${resourcePath} **/
var definitions = require(${request})
var runtime = require(${runtime})
var { withDefinitionsComponent, withDefinitionsHook, withDefinitionsContextHook } = runtime
var Trans = withDefinitionsComponent(definitions)
var useTrans = withDefinitionsHook(definitions)
var useContextTrans = withDefinitionsContextHook(definitions)
Object.defineProperty(exports, '__esModule', { value: true });
exports.default = useTrans
exports.definitions = definitions
exports.Trans = Trans
exports.useTrans = useTrans
exports.useContextTrans = useContextTrans
`;
}
function getModuleExports() {
return `export {
useTrans as default, definitions, Trans, useTrans, useContextTrans
} from '@ices/react-locale'
`;
}
exports.getModuleCode = getModuleCode;
exports.getModuleExports = getModuleExports;
//# sourceMappingURL=loader.js.map