Skip to content

Commit

Permalink
fixed build issue & add preview cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
noxify committed Jan 21, 2024
1 parent 13a3605 commit 726fc46
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions apps/nextjs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import "@acme/auth/env"
const config = {
reactStrictMode: true,
experimental: {
serverComponentsExternalPackages: [
"oslo",
"@icons-pack/react-simple-icons",
],
serverComponentsExternalPackages: ["@icons-pack/react-simple-icons"],
},
/** Enables hot reloading for local packages without a build step */
transpilePackages: [
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"packageManager": "[email protected]",
"scripts": {
"build": "turbo build",
"preview": "pnpm -F nextjs start",
"clean": "git clean -xdf node_modules",
"clean:workspaces": "turbo clean",
"db:push": "pnpm -F db push",
Expand Down
5 changes: 4 additions & 1 deletion packages/db/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"server only"

import { drizzle } from "drizzle-orm/mysql2"
import mysql from "mysql2/promise"

Expand All @@ -10,11 +12,12 @@ export { mySqlTable as tableCreator } from "./schema/_table"

export * from "drizzle-orm"

const connection = await mysql.createConnection({
const connection = mysql.createPool({
host: process.env.DB_HOST!,
user: process.env.DB_USERNAME!,
password: process.env.DB_PASSWORD!,
database: process.env.DB_NAME!,
connectionLimit: 2, // default is 10
})

export const db = drizzle(connection, { schema, mode: "default" })

0 comments on commit 726fc46

Please sign in to comment.