hoangvvo / nextjs-mongodb-app

A Next.js and MongoDB web application, designed with simplicity for learning and real-world applicability in mind.
https://nextjs-mongodb.now.sh/
MIT License
1.53k stars 286 forks source link

Implement Aliases In Application #88

Closed yegorkay closed 3 years ago

yegorkay commented 4 years ago

This feature implements path aliases to make modules easier to read and access throughout the application.

import middleware from '../../../../middlewares/middleware';

becomes:

import middleware from 'middlewares/middleware';

See relevant NextJS docs

vercel[bot] commented 4 years ago

This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hoangvvo/nextjs-mongodb-app/oyei4cjtj ✅ Preview: https://nextjs-mongodb-app-git-fork-yegorkay-feature-alias-paths.hoangvvo.vercel.app

hoangvvo commented 4 years ago

I'm so sorry for missing out the PR! Should we have some prefix to the path, to deal with cases where middlewares, lib, etc are npm packages. Seems like an @ will do (just like in the doc)