Skip to content
Fix Code Error

How to change default ‘page’ Directory name or Location in nextjs?

April 7, 2021 by Code Error
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

Related Articles

  • Eclipse will not start and I haven't changed anything
  • NextJS deploy to a specific URL path
  • How to add favicon.ico in ASP.NET site
  • Execution failed for task…
  • Ukkonen's suffix tree algorithm in plain English
  • Error : Ineffective mark-compacts near heap limit…
  • Apache server keeps crashing, "caught SIGTERM,…
  • How to set favicon.ico properly on vue.js webpack project?
  • Npm run serve Error
  • Plugin…
  • TypeError: Cannot read property 'webpackJsonp' of undefined
  • HTML 5 Favicon - Support?
  • Adding Dynamic Input Fields With VueJs
  • android studio 0.4.2: Gradle project sync failed error
  • Favicon not showing up in Google Chrome
  • How to add a favicon to a Next.js static site?
  • Import css and sass files nextjs 7
  • How to vertically align an image inside a div
  • What is the best practice for creating a favicon on…
  • Where should I place my Vaadin 10+ static files?
  • SQLException: No suitable Driver Found for…
  • Serving favicon.ico in ASP.NET MVC
  • What is the JSF resource library for and how should…
  • Centering in CSS Grid
  • Serving favicon next.js
  • What's the difference between Instant and LocalDateTime?
  • Gradle: Execution failed for task ':processDebugManifest'
  • Using reactstrap with Next.js
  • ExpressJS How to structure an application?
  • laravel vuejs/axios put request Formdata is empty
  • Can't access Eclipse marketplace
  • Next.js Redirect from / to another page
  • Android- Error:Execution failed for task…
  • Good way of getting the user's location in Android
  • How do SO_REUSEADDR and SO_REUSEPORT differ?
  • How to make the overflow CSS property work with…
  • What is the difference between `next export` and…
  • React NextJS app, installed webpack, then removed…
  • Why am I getting a "401 Unauthorized" error in Maven?
  • In CSS Flexbox, why are there no "justify-items" and…
  • How to make a SIMPLE C++ Makefile
  • How do I put my website's logo to be the icon image…
  • Logging best practices
  • Pass props in Link react-router
  • Start redis-server with config file
  • The definitive guide to form-based website authentication
  • Exception : AAPT2 error: check logs for details
  • Use absolute imports in Next.js app deployed with ZEIT Now
  • Have a common header layout in nextjs
  • Best practice for Django project working directory structure
  • How should I deal with "package 'xxx' is not…
  • How to build an android library with Android Studio…
  • python object() takes no parameters error
  • Add Bootstrap Glyphicon to Input Box
  • Android Studio: Unable to start the daemon process
  • Next.js source maps with typescript on Sentry
  • Problems using Maven and SSL behind proxy
  • Best practice for Next.js data fetching inside a component
  • Render normalize.css + emotion styles with Next.js
  • Various ways to remove local Git changes
  • What are the real-world strengths and weaknesses of…
  • apache server reached MaxClients setting, consider…
  • Peak signal detection in realtime timeseries data
  • Can't change default nuxt favicon
  • Importing a GitHub project into Eclipse
  • Failed to execute goal…
  • How to integrate Nextjs + styled-components with material-ui
  • Text size and different android screen sizes
  • Necessary to add link tag for favicon.ico?
  • unable to deploy next js to azure
  • Backbone.js frontend with RESTful Rails backend?
  • How to upload a file in Django?
  • How to configure nextjs 9 and ant design less compatibility?
  • How to use html template with vue.js
  • jQuery Mobile: document ready vs. page events
  • How does PHP 'foreach' actually work?
  • Next.js Global CSS cannot be imported from files…
  • Integrate ZXing in Android Studio
  • How do I prevent node from logging an exception to…
  • How can I find the product GUID of an installed MSI setup?
  • NextJS component level SASS styling
  • What does AngularJS do better than jQuery?
  • How to build next.js production?
  • How to add bootstrap in angular 6 project?
  • What are the different usecases of PNG vs. GIF vs.…
  • dotenv values not loaded in nextjs
  • What is your most productive shortcut with Vim?
  • How to add a browser tab icon (favicon) for a website?
  • Why does C++ code for testing the Collatz conjecture…
  • commandButton/commandLink/ajax action/listener…
  • How to find out client ID of component for ajax…
  • SameSite warning Chrome 77
  • How to configure Next.js with Antd / Less and Sass /…
  • For-each over an array in JavaScript
  • Could not calculate build plan: Plugin…
  • Memcached vs. Redis?
  • iOS Launching Settings -> Restrictions URL Scheme
  • data.table vs dplyr: can one do something well the…
  • nextjs route middleware for authentication
  • How to download and save an image in Android

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

Vuejs and Page Refresh on click

Next Post:

Vue.js: Default data in component is always overridden with v-with

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Making CORS request using Backbone in IE8/9
  • Edit item description in array in Vue JS
  • Ember.JS ActiveModelAdapter and Active Model Serializers default behavior
  • Backbone.js Collection filter top 10 models
  • Slider cannot be dragged (Cannot call method ‘addClass’ of undefined ) (jQuery UI Bootstrap + Twitter Bootstrap)
  • Underscore pluck not working on array of models?
  • Insert a script tag inside template Vue
  • Nginx reverse proxy to both nextjs and react-admin
  • Can’t get Chart.js to run in a Vue.js component
  • Aurelia Child Route by using Multiple
  • emberjs action event.target is undefined
  • When dynamically adding dart polymer elements, how do I get observable variables to on DOM
  • Vue 3 Composition API Provide/Inject not working in Single File Components
  • Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead
  • How to pass a model to a template rendered from a route in Ember 1.6
  • Backbonejs – Avoid parse after save
  • BackboneJS: View renders fine, but refreshes with undefined collection
  • Explicit call vuex actions in the `.vue` component detach/ready function
  • jest.fn() claims not to have been called, but has
  • I18Next doesn’t work when loading data from backend

Categories Tags

.net (1074) ajax (457) android (2318) angularjs (553) arrays (1091) asp.net (630) backbone.js (2266) bash (760) c++ (4925) css (2466) date (485) datetime (471) ember.js (1281) excel (566) git (1084) html (3345) ios (701) java (4508) javascript (9396) jquery (2999) json (943) laravel (507) linux (797) list (561) mysql (1310) node.js (895) oracle (475) pandas (449) php (2230) python (4372) r (537) reactjs (545) regex (554) shell (517) sql (1847) sql-server (1217) string (1360) tsql (471) twitter-bootstrap (516) typescript (418) vue-component (716) vue.js (5167) vuejs2 (1677) vuetify.js (495) windows (590)
© 2021 Fix Code Error