Using subpath imports in React Native

Viewed 62

Is it possible to use subpath imports in React Native?

I have the following package.json:

{
    ...
    "imports": {
        "#utils/*": "./src/utils/*",
    }
}

and am trying to use them as follows:

import {someUtility} from '#utils/someUtility.js';

with the following in the file ./src/utils/someUtility.js:

export const someUtility = 'utility';

but receive the following error:

Error: Unable to resolve module #utils/someUtility from "${CURRENT_PATH}". #utils/someUtility could not be found within the project.
0 Answers
Related