How does @server/utils work?
When I try to add a file server/utils/index.ts, I don't seem to be able to import with
import { x } from @server/utils
I get an error: Cannot find module '@server/utils'
6 Replies
Does
~/server/utils
resolve to {srcDir}/server/utils
?Yes
You forgot a
/
after @
in the path.
@/server/utils
@/server/utils
what's the diff between ~ and @?
preference
The following aliases resolve to the project root, use whichever floats your boat.