package.cjs.initializers.index.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
{"version":3,"file":"index.js","names":["_useDisplayErrorPage","_interopRequireDefault","require","_axios","_dayjs","_globalProps","_i18n","_interopRequireWildcard","_logger","_mixpanel","_reactDevTools","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof3","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","globalProps","exports","initializeApplication","_ref","translationResources","skip","initializeGlobalProps","window","_typeof2","axios","initializeAxios","i18n","initializeI18n","logger","initializeLogger","dayjs","initializeDayjs","timezone","process","env","NODE_ENV","disableReactDevTools","pageLoader","document","getElementById","remove","initializeMixpanel"],"sources":["../../../src/initializers/index.js"],"sourcesContent":["// TODO: kept for backward compatibility.\nimport useDisplayErrorPage from \"react-utils/useDisplayErrorPage\";\n\nimport initializeAxios from \"./axios\";\nimport initializeDayjs from \"./dayjs\";\nimport initializeGlobalProps from \"./globalProps\";\nimport initializeI18n, { taxonomies } from \"./i18n\";\nimport initializeLogger from \"./logger\";\nimport initializeMixpanel from \"./mixpanel\";\nimport disableReactDevTools from \"./reactDevTools\";\n\n// eslint-disable-next-line import/no-mutable-exports\nlet globalProps = {};\n\nexport { globalProps, useDisplayErrorPage, taxonomies };\n\nexport default function initializeApplication({ translationResources, skip }) {\n if (!skip?.globalProps) {\n initializeGlobalProps();\n // eslint-disable-next-line @bigbinary/neeto/no-globalProps-reassignment\n globalProps = window.globalProps;\n }\n\n if (typeof skip?.axios === \"object\" || !skip?.axios) {\n initializeAxios(skip?.axios);\n }\n\n if (!skip?.i18n) initializeI18n(translationResources);\n\n if (!skip?.logger) initializeLogger();\n\n if (!skip?.dayjs) initializeDayjs(skip?.timezone);\n\n if (process.env.NODE_ENV === \"production\") disableReactDevTools();\n\n const pageL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