Compare commits

...

2 Commits

Author SHA1 Message Date
58e1afaa45 chore(release): 1.6.4 2026-03-03 14:14:00 +08:00
250b7c5261 Fix Prisma 2026-03-03 12:03:30 +08:00
5 changed files with 62 additions and 1 deletions

View File

@@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
## [1.6.4](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.3...v1.6.4) (2026-03-03)
## [1.6.3](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.2...v1.6.3) (2026-03-03) ## [1.6.3](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.2...v1.6.3) (2026-03-03)
## [1.6.2](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.1...v1.6.2) (2026-02-25) ## [1.6.2](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.1...v1.6.2) (2026-02-25)

View File

@@ -3,12 +3,20 @@ const nextConfig = {
reactStrictMode: false, reactStrictMode: false,
experimental: { experimental: {
serverActions: true, serverActions: true,
serverComponentsExternalPackages: ['@prisma/client'],
}, },
output: "standalone", output: "standalone",
staticPageGenerationTimeout: 180, // tingkatkan menjadi 3 menit staticPageGenerationTimeout: 180, // tingkatkan menjadi 3 menit
eslint: { eslint: {
ignoreDuringBuilds: true, ignoreDuringBuilds: true,
}, },
webpack: (config, { isServer }) => {
if (isServer) {
config.externals = config.externals || [];
config.externals.push('@prisma/client');
}
return config;
},
// async headers() { // async headers() {
// return [ // return [
// { // {

View File

@@ -1,6 +1,6 @@
{ {
"name": "hipmi", "name": "hipmi",
"version": "1.6.3", "version": "1.6.4",
"private": true, "private": true,
"prisma": { "prisma": {
"seed": "bun prisma/seed.ts" "seed": "bun prisma/seed.ts"

41
scripts/postbuild.js Normal file
View File

@@ -0,0 +1,41 @@
const fs = require('fs');
const path = require('path');
const standaloneDir = path.join(__dirname, '../.next/standalone');
const prismaDir = path.join(__dirname, '../node_modules/.prisma');
console.log('🚀 Running postbuild script...');
// Copy Prisma binaries ke standalone output
if (fs.existsSync(prismaDir)) {
const dest = path.join(standaloneDir, 'node_modules/.prisma');
fs.mkdirSync(path.dirname(dest), { recursive: true });
fs.cpSync(prismaDir, dest, { recursive: true });
console.log('✓ Prisma binaries copied to standalone output');
} else {
console.warn('⚠ Prisma binaries directory not found, skipping...');
}
// Copy schema.prisma jika diperlukan
const schemaSrc = path.join(__dirname, '../prisma/schema.prisma');
const schemaDest = path.join(standaloneDir, 'prisma/schema.prisma');
if (fs.existsSync(schemaSrc)) {
fs.mkdirSync(path.dirname(schemaDest), { recursive: true });
fs.copyFileSync(schemaSrc, schemaDest);
console.log('✓ schema.prisma copied to standalone output');
} else {
console.warn('⚠ schema.prisma not found, skipping...');
}
// Copy prisma client dari node_modules/@prisma/client
const prismaClientSrc = path.join(__dirname, '../node_modules/@prisma/client');
const prismaClientDest = path.join(standaloneDir, 'node_modules/@prisma/client');
if (fs.existsSync(prismaClientSrc)) {
fs.mkdirSync(path.dirname(prismaClientDest), { recursive: true });
fs.cpSync(prismaClientSrc, prismaClientDest, { recursive: true });
console.log('✓ @prisma/client copied to standalone output');
} else {
console.warn('⚠ @prisma/client not found, skipping...');
}
console.log('✅ Postbuild script completed!');

View File

@@ -12,11 +12,21 @@ if (process.env.NODE_ENV === "production") {
prisma = new PrismaClient({ prisma = new PrismaClient({
// Reduce logging in production to improve performance // Reduce logging in production to improve performance
log: ['error', 'warn'], log: ['error', 'warn'],
datasources: {
db: {
url: process.env.DATABASE_URL,
},
},
}); });
} else { } else {
if (!global.prisma) { if (!global.prisma) {
global.prisma = new PrismaClient({ global.prisma = new PrismaClient({
log: ['error', 'warn', 'info', 'query'], // More verbose logging in development log: ['error', 'warn', 'info', 'query'], // More verbose logging in development
datasources: {
db: {
url: process.env.DATABASE_URL,
},
},
}); });
} }
prisma = global.prisma; prisma = global.prisma;