mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
cd1d3640a9
* 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
24 lines
553 B
JavaScript
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
|
|
}
|
|
})
|