'Where and how to import custom Object prototype properties file which is required globally in gatsby during develop & build step?

CONTEXT :

  • I have a typescript file which contains CUSTOM OBJECT PROTOTYPE functions / properties.
  • This file ( utils.ts ) should be available globally when the app starts and should extend the existing Object prototype.
  • Importing this file gatsby-browser.js is working in gatsby develop mode.
  • When building / deploying this fails.

QUESTION :

  • How and where should i import these kind of files in gatsby, so that it's available during build phase globally ?

enter image description here

enter image description here

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source