Is there a way to map a repeating import path in Webpack/NextJs?

I have a NextJs Project (v14.1.3) and I was wondering if there’s a way to make it so that this import

import foo from 'path/to/foo/foo'

Could instead be written as

import foo from 'path/to/foo'

While still keeping the foo file inside the foo directory