Skip to content

Commit

Permalink
Merge pull request #224 from appsignal/next-js-production-backend-sou…
Browse files Browse the repository at this point in the history
…rce-maps

Next js production backend source maps
  • Loading branch information
unflxw authored Jul 29, 2024
2 parents a23a2c2 + 3bf8daa commit 64bcf6f
Show file tree
Hide file tree
Showing 12 changed files with 1,156 additions and 413 deletions.
6 changes: 6 additions & 0 deletions nodejs/nextjs-13-app/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ const nextConfig = {
// Add the following line inside the object
instrumentationHook: true,
},
webpack: (config, {isServer}) => {
if (isServer) {
config.devtool = 'eval-source-map'
}
return config
}
};

module.exports = nextConfig
2 changes: 1 addition & 1 deletion nodejs/nextjs-13-app/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nodejs/nextjs-13-app/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"start": "NODE_OPTIONS=--enable-source-maps next start",
"lint": "next lint"
},
"dependencies": {
"@appsignal/nodejs": "^3.0.17",
"@appsignal/nodejs": "latest",
"@types/node": "20.5.0",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.7",
Expand Down
6 changes: 6 additions & 0 deletions nodejs/nextjs-13-pages/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ const nextConfig = {
experimental: {
instrumentationHook: true,
},
webpack: (config, {isServer}) => {
if (isServer) {
config.devtool = 'eval-source-map'
}
return config
}
}

module.exports = nextConfig
2 changes: 1 addition & 1 deletion nodejs/nextjs-13-pages/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nodejs/nextjs-13-pages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"start": "NODE_OPTIONS=--enable-source-maps next start",
"lint": "next lint"
},
"dependencies": {
"@appsignal/javascript": "^1.3.26",
"@appsignal/nodejs": "^3.0.13",
"@appsignal/nodejs": "latest",
"@appsignal/react": "^1.0.22",
"@types/node": "18.15.11",
"@types/react": "18.0.35",
Expand Down
6 changes: 6 additions & 0 deletions nodejs/nextjs-14-app/app/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ const nextConfig = {
instrumentationHook: true,
serverComponentsExternalPackages: ['@appsignal/nodejs'],
},
webpack: (config, {isServer}) => {
if (isServer) {
config.devtool = 'eval-source-map'
}
return config
}
};

export default nextConfig;
Loading

0 comments on commit 64bcf6f

Please sign in to comment.