JS Cloud functions error with absolute path import

Viewed 643

I have a typescript project like this with some cloud functions

tsconfig.json
/functions
|--index.ts
|--package.json
/src
|--App.tsx

In my App.tsx folders all import are absolute with this code in my tsconfig.json :

    "baseUrl": "../src",
    "paths": {
      "src/*": ["*"]
    }

Example of an absolute import in my App.tsx :

import { theme } from 'src/utils/theme/theme'

But in my cloud functions i need to import some file from my /src directory and i am not able to import it I have an error after start "firebase serve" :

Error: Cannot find module 'src/utils/theme/theme'

I don't know how to fix the current path in cloud functions to import all my file with absolute path

Thanks for help

0 Answers
Related