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