plasmicapp / plasmic

Visual builder for React. Build apps, websites, and content. Integrate with your codebase.
https://www.plasmic.app
MIT License
4.72k stars 382 forks source link

@plasmic/loader-nextjs ignores custom build directory, is not configurable #45

Open isolationism opened 1 year ago

isolationism commented 1 year ago

Next.js has a setting to configure the build/output directory:

https://nextjs.org/docs/api-reference/next.config.js/setting-a-custom-build-directory

... which makes this line in the loader a problem:

https://github.com/plasmicapp/plasmic/blob/5198eac32c76b03ce9cf0cace0c650e22ba28144/packages/loader-nextjs/src/cache.ts#L40

My particular case is the use of nx (a monorepo) which builds the deployable in an entirely different directory from the project root/cwd, i.e ./dist/apps/my-project/.next.

According to the "Legacy API" docs, once upon a time PlasmicLoader supported configuring these directories, but seem to have disappeared post-refactoring for greater abstraction and re-use.

Any plans to restore support for configuring plasmic's cache directory manually, or matching the build directory used by Next?