-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
40 lines (39 loc) · 1.37 KB
/
Copy pathnext.config.js
File metadata and controls
40 lines (39 loc) · 1.37 KB
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
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
webpack: (config) => {
config.resolve.alias = {
...config.resolve.alias,
};
return config;
},
experimental: {
// Keep native/binary-backed packages out of the webpack bundle so they
// are resolved from node_modules at runtime.
serverComponentsExternalPackages: [
"pg",
"fluent-ffmpeg",
"ffmpeg-static",
"ffprobe-static",
],
// Externalizing alone does NOT trace the ffmpeg/ffprobe binaries into the
// serverless function bundle — they must be included explicitly, scoped to
// the two routes that shell out to them (bundling ~120MB into every
// function would blow the size limit).
// Keys are picomatch patterns tested (contains-mode) against normalized
// app-route paths like "/app/api/inngest". The dynamic [bookId] segment
// must be matched with "*" — literal brackets in a key are parsed as a
// glob character class and never match.
outputFileTracingIncludes: {
"/api/inngest": [
"./node_modules/ffmpeg-static/ffmpeg",
"./node_modules/ffprobe-static/bin/linux/**",
],
"/api/admin/books/*/generate-shorts": [
"./node_modules/ffmpeg-static/ffmpeg",
"./node_modules/ffprobe-static/bin/linux/**",
],
},
},
};
module.exports = nextConfig;