-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to change where Next looks for pages? #2202
Comments
When you create your custom server you can pass a argument const next = require('next')
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dir: './bin', dev }) Next.js it's going to use |
Ah, that is exactly what I was looking for but couldn't find in the docs 😢 Nice one mate, thank you! |
I followed the idea of specifying the dir property for the next app and it worked, thanks. But when I run
How can I specify the pages directory when running the build task? --EDIT-- |
Posted #8451 |
So, I am wanting to build a Next app with T$.
To do that, I install
typescript
and compile my Next app into abin
directory:In
package.json
, I have ascript
:node bin/server.js
. When I run said script, Next will look in./pages
instead of./bin/pages
(i.e. from thecwd
not__dirname
). To work around this, I have tocd
intobin
before runningnode ./server.js
(a one-line would be(cd ./bin && node ./server)
, if you're reading this and you need a work-around)It it possible to configure where Next looks for pages?
The text was updated successfully, but these errors were encountered: