Replies: 3 comments 2 replies
-
same question |
Beta Was this translation helpful? Give feedback.
0 replies
-
After digging through the code of NX and next a bit, what I came up with was:
mynextapp/next.config.js: + experimental: {
+ appDir: true,
+ }, mynextapp/project.json: "production": {
"buildTarget": "mynextapp:build:production",
- "dev": false,
- "customServerTarget": "mynextapp:serve-custom-server:production"
} mynextapp/server/main.ts: import { workspaceRoot } from "@nrwl/devkit";
import { loadBindings } from "next/dist/build/swc";
import * as path from "path";
const dir = process.env.NX_NEXT_DIR || path.join(__dirname, "..");
const dev = process.env.NODE_ENV === "development";
const hostname = process.env.HOST;
const port = process.env.PORT ? parseInt(process.env.PORT) : 4200;
const devServerOptions = {
allowRetry: true,
dev,
dir,
hostname,
isNextDevCommand: true,
port,
};
async function main() {
const bindings: any = await loadBindings();
const server = bindings.turbo.startDev({
...devServerOptions,
showAll: true,
root: workspaceRoot,
});
return server;
}
main().catch((err) => {
console.error(err);
process.exit(1);
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can do this now with the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I dont have good understnading of nx and the configs/generators it provides. And i'm trying to use the --turbo config option next js recently introduced with next 13. I already upgraded all my next, nx & @nrwl/* packages but cant seem to make --turbo option work.
I tried doing it in the project.json like this
"buildTarget": "apps-prjam:build:development --turbo"
, doesnt seem to do anything. Can anyone help with this?Beta Was this translation helpful? Give feedback.
All reactions