package.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","initializeAxios","initializeDayjs","initializeGlobalProps","initializeI18n","taxonomies","initializeLogger","initializeMixpanel","disableReactDevTools","globalProps","initializeApplication","_ref","translationResources","skip","window","_typeof","axios","i18n","logger","dayjs","timezone","process","env","NODE_ENV","pageLoader","document","getElementById","remove"],"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 pageLoader = document.getElementById(\"neeto-page-loader\");\n if (pageLoader) pageLoader.remove();\n\n initializeMixpanel(skip);\n}\n"],"mappings":";AAAA;AACA,OAAOA,mBAAmB;AAE1B,OAAOC,eAAe;AACtB,OAAOC,eAAe;AACtB,OAAOC,qBAAqB;AAC5B,OAAOC,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