@lewebsimple/nuxt-prisma
v0.0.3
Published
Prisma module for Nuxt
Readme
Nuxt Prisma
Prisma module for Nuxt for doing amazing things.
Features
- 🚀 Prisma client generation before build and optionnally when schema changes
- 🪄 Auto-import
prismaclient on the server side - 🐛 Fix resolution of
.prisma/client/index-browser(see prisma#12504)
Quick Setup
Install the module to your Nuxt application with one command:
npx nuxi module add @lewebsimple/nuxt-prismaSet up Prisma ORM with the init command of the Prisma CLI:
npx prisma init --datasource-provider sqliteModel your data in the Prisma schema (see the Quickstart guide).
The Prisma client is generated automatically before build in development and production (you should restart the development server each time the Prisma schema changes).
That's it! You can now use the auto-imported prisma client in the server handlers of your Nuxt app ✨
Options
watchSchema
Run prisma generate automatically when scheme.prisma changes.
- Type:
boolean - Default: true
Contribution
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Release new version
npm run release