summaryrefslogtreecommitdiff
path: root/next.config.ts
blob: 98c58d2e5cbfbc985e9012d1a7cfa946cc0ff02a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  serverExternalPackages: ['pino', 'pino-pretty', 'node-cron', 'oracledb','sharp', '@pdftron/pdfnet-node'],
  
  reactStrictMode: false,
  eslint: {
    ignoreDuringBuilds: true,
  },
  typescript: {
    ignoreBuildErrors: true,
  },
  webpack: (config) => {
    // [김준회] turbo의 resolveAlias와 동일한 설정을 webpack에 적용
    config.resolve.alias = {
      ...config.resolve.alias,
      '@azure/app-configuration': false,
      '@azure/identity': false,
      '@azure/keyvault-secrets': false,
      'oci-common': false,
      'oci-objectstorage': false,
      'oci-secrets': false,
      'better-sqlite3': false,
      'mysql': false,
      'mysql2': false,
      'pg-query-stream': false,
      'sqlite3': false,
      'tedious': false,
    };
    
    config.ignoreWarnings = [
      ...(config.ignoreWarnings || []),
      // [김준회] handlebars require.extensions 경고 무시
      {
        module: /node_modules\/handlebars\/lib\/index\.js/,
        message: /require\.extensions is not supported by webpack/,
      },
      // [김준회] knex import 관련 경고 무시 (webpack에서 정적 분석 진행할 때, 런타임에 결정되는 경로를 미리 알 수 없어 발생하는 경고임. 실제 동작에는 문제가 없음.)
      {
        module: /node_modules\/knex/,
        message: /Critical dependency: the request of a dependency is an expression/,
      },
      {
        module: /node_modules\/knex/,
        message: /Can't resolve/,
      },
    ];
    
    return config;
  },
  experimental: {
    serverActions: {
      // [김준회] DRM 복호화/암호화 백엔드로 보낼 때 사이즈 제한 변경(기본값: 1MB)
      // DDoS 공격을 방지하기 위해 기본값이 1MB로 설정되어 있음. 암호화된 파일 중 큰 파일(도면 등)도 1GB 이하로 가정하여 설정 (파일별로 서버액션 개별 호출)
      bodySizeLimit: '1024mb',
    },
    turbo: {
      treeShaking: false,
        minify: false,
        unstablePersistentCaching: false,
        // [김준회 프로] 오라클 DB 사용을 위한 라이브러리/nextjs 번들러 호환 문제 해결
        resolveAlias: {
          '@azure/app-configuration': 'data:text/javascript,export default {};',
          '@azure/identity': 'data:text/javascript,export default {};',
          '@azure/keyvault-secrets': 'data:text/javascript,export default {};',
          'oci-common': 'data:text/javascript,export default {};',
          'oci-objectstorage': 'data:text/javascript,export default {};',
          'oci-secrets': 'data:text/javascript,export default {};',
          // knex 관련 데이터베이스 드라이버들
          'better-sqlite3': 'data:text/javascript,export default {};',
          'mysql': 'data:text/javascript,export default {};',
          'mysql2': 'data:text/javascript,export default {};',
          'pg-query-stream': 'data:text/javascript,export default {};',
          'sqlite3': 'data:text/javascript,export default {};',
          'tedious': 'data:text/javascript,export default {};',
        },
    }
  },
};

export default nextConfig;