How to change default ‘page’ Directory name or Location in nextjs?
Posted By: Anonymous
I am trying to clean up project structure by moving ‘Page’ directory form root location to some internal folder’s like client or frontend etc. Is there way to do it? and can I move css and images folder as well?
Solution
As far as the pages
directory is concerned, it’s not configurable yet but it has been discussed so the feature might be available some time in the future: https://github.com/zeit/next.js/pull/936
Images are usually best kept in the static
folder, eg. /static/img/favicon.png
, if you move your images somewhere you’ll lose Next.js feature of automatically setting up static files serving under /static/*
.
Regarding CSS however, you’re free to move these files under any folder you want because you have to import them in your code yourself: https://github.com/zeit/next-plugins/tree/master/packages/next-css
Answered By: Anonymous
Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.