Next.js: Consider `next.config.js`

Created on 3 Dec 2016  路  2Comments  路  Source: vercel/next.js

next is fantastic! However, I'd like to be able to override some configuration, such as the path to pages (/pages/index.js -> /src/pages/index.js).

Considering, some other people are asking for webpack overrides, would it make sense to have a high-level config that allows for minimal settings. This could also potentially go in package.json as a "next" option.

"next": {
  "pages_directory": "./src/pages",
  "webpack": {
    "dev": "./webpack.config.js",
    "prod": "./webpack.prod.config.js"
  },
  ...
}

Another (related) idea to consider:

All 2 comments

We have no plan to support overriding pages path fow now, but https://github.com/zeit/next.js/pull/222 is what you want.

In my package.json I simply add my src/ folder to the scripts - such that - "dev": "next src/" This seems to work fine for me. Is there a problem with doing things this way?

Was this page helpful?
0 / 5 - 0 ratings