How to start a Next server when hosting Plasmic Studio?

Hey everyone, when hosting Plasmic Studio as a Next.js app in production should I be running next dev or next start or something else?

If you’re using localhost, next dev is sufficient. If your app host is deployed to production, you’d want to build it and serve it with next start.

Thanks @chungwu! Do I understand right that will still pull content dynamically from Plasmic, it just won’t rebuild the TypeScript and SCSS of my app?

Similarly, should I keep the preview option set to true or toggle it to false in production?

“Custom app host” is for registering custom components; you wouldn’t need to use it unless you are trying to use custom code components with Plasmic. If you do, then whatever components are registered from the custom app host are the code components you can use in Plasmic.

For normal production deployments, you should use build and use next start. If you make updates to Plasmic, then you will need to rebuild your deployment. This is most easily accomplished with incremental static regeneration – in your getStaticProps(), you can just return {revalidate: 300}, which means it will try to fetch new changes from Plasmic ~300 seconds after it’s been published. See https://docs.plasmic.app/learn/nextjs-quickstart/#auto-load-all-plasmic-pages

You should set preview: false in production

got it, I’m referring to deploying a custom app host to production once development of the custom components is done