What I'm basically trying to achieve is to be able to do:
import {thingOne, thingTwo} from 'functions/myFunctions.js'
instead of
import {thingOne, thingTwo} from '../../functions/myFunctions.js'
Paths are obviously hypothetical. The idea is that the functions directory exists in the root of the project - in the same directory as package.json.
I've been able to achieve this whilst using React by specifying a baseUrl in jsconfig.json, but that does nothing whilst working with a standard nodejs project. I'd prefer not to use any extra packages/dependencies for this.
I've also tried setting the environment variable NODE_PATH to './', as I've seen suggested elsewhere, but that didn't change anything either. If it's relevant, I'm using Ubuntu via WSL2, and Node.js v17.7.2. Thank you