// eslint-disable-next-line @typescript-eslint/no-var-requires
const withNx = require('@nrwl/next/plugins/with-nx');
/**
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
nx: {
// Set this to true if you would like to to use SVGR
// See: https://github.com/gregberge/svgr
svgr: false,
},
distDir: '.dist',
target: 'serverless',
};
module.exports = withNx(nextConfig);
Note: it did not happened when netlify.toml was at the root of the monorepo. I moved it to apps/landing because I’ve got several apps and figured I would add this file and modify the publish directory for each apps according to Monorepos | Netlify Docs
Reading further, I believe this is an issue due to the fact that there is no package.json in apps/landing so the runner doesnt resolves dependencies. How should I proceed to make that work with NX?
Another solution that could work would be to keep the netlify.toml file at root and dynamically change the publish path, probably using env variables. But I’m not sure how to do so?
Glad to hear this is working now Additionally, thanks for following up with the detailed steps. This will definitely be beneficial for future Forums members who encounter something similar!
Hey @GreatHawkeye, what do you mean by your sixth step, “adding essential nextjs plugins to my nextjs apps”? Did you figure out a way to have a netlify.toml for each of your apps instead of one at the root?
You can have multiple netlify.tomls easily. You simply need to set the base path in the UI and not set any base path in netlify.toml and that would do.