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

24 lines
553 B
JavaScript
Raw Normal View History

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
}
})