Skip to content

Commit 00326b0

Browse files
committed
refactor: add the pino-pretty as external dependency to avoid module-not-found error during builds.
1 parent 9e461df commit 00326b0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

next.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ const ContentSecurityPolicy = `
55
frame-ancestors 'self' https://app.safe.global;
66
`;
77

8+
/** @type {import('next').NextConfig} */
89
module.exports = {
910
typedRoutes: true,
11+
webpack: (config, { isServer }) => {
12+
// On "next build" command, pino-pretty should be set as external deps to avoid module-not-found problem.
13+
if (isServer) {
14+
config.externals.push('pino-pretty');
15+
}
16+
return config;
17+
},
1018
reactStrictMode: true,
1119
async headers() {
1220
return [

0 commit comments

Comments
 (0)