prisma / nuxt-prisma

Prisma ORM integration for Nuxt
https://www.prisma.io/docs/orm/more/help-and-troubleshooting/help-articles/prisma-nuxt-module
58 stars 9 forks source link

Module uses root folder *always* #32

Open Harm-Nullix opened 1 month ago

Harm-Nullix commented 1 month ago

So I have the structure of the following in my nuxt.config:

  serverDir: path.resolve('./src/backend'),
  rootDir: path.resolve('.'),
  srcDir: path.resolve('./src'),
  dir: {
    assets: path.resolve('./src/frontend/assets'),
    plugins: path.resolve('./src/frontend/plugins'),
    middleware: path.resolve('./src/frontend/middleware'),
    layouts: path.resolve('./src/frontend/layouts'),
    pages: path.resolve('./src/frontend/pages'),
    public: path.resolve('./src/backend/public'),
    static: path.resolve('./src/backend/public'),
  },

This works for everything well, but this module insist on using the rootDir. It would be really nice if that would be configurable, because I have my prisma files stored in the backend folder instead of at the root.

Cause of pain: https://github.com/prisma/nuxt-prisma/blob/main/src/module.ts#L65

ankur-arch commented 1 month ago

Hey @Harm-Nullix 👋 , thanks for reporting the issue! We plan to make the module usable with the prisma files being on a separate directory.