1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-sentry/next.config.js
Adam Stankiewicz cd1d3640a9 Improve with-sentry example (#5727)
* Improve with-sentry example

* remove nonexisting keys from request and update errorInfo handling

* readd query and pathname

* read query and params and add pathname and query to client
2018-12-10 23:59:12 +01:00

24 lines
553 B
JavaScript

const webpack = require('webpack')
const nextSourceMaps = require('@zeit/next-source-maps')()
const SENTRY_DSN = ''
module.exports = nextSourceMaps({
webpack: (config, { dev, isServer, buildId }) => {
if (!dev) {
config.plugins.push(
new webpack.DefinePlugin({
'process.env.SENTRY_DSN': JSON.stringify(SENTRY_DSN),
'process.env.SENTRY_RELEASE': JSON.stringify(buildId)
})
)
}
if (!isServer) {
config.resolve.alias['@sentry/node'] = '@sentry/browser'
}
return config
}
})