Closed tjmadonna closed 2 months ago
@tjmadonna I've seen usages of the path alias in Nodejs, different from yours:
import { something } from '#some/thing';
The above works corresponding to the imports
field specified in package.json
:
{
"imports": {
"#*": "./src/*"
}
}
Can you help me understand why you chose @
over #
?
It's the convention that Next.js uses.
This shouldn't change anything. Path alias imports and relative imports can be used in the same project/file. I had to add the alias to the webpack config as well.
Changes
@
for thesrc
directory for cleaner importsExample