Skip to content

Instantly share code, notes, and snippets.

@nicooprat
Created December 18, 2018 12:07
Show Gist options
  • Save nicooprat/15a0c4f6a8396ba855e31b58aa4d323a to your computer and use it in GitHub Desktop.
Save nicooprat/15a0c4f6a8396ba855e31b58aa4d323a to your computer and use it in GitHub Desktop.
Nuxt, Webpack & Bugsnag
const { BugsnagBuildReporterPlugin, BugsnagSourceMapUploaderPlugin } = require('webpack-bugsnag-plugins')
module.exports = {
...
build: {
extend (config, { isDev, isClient }) {
if (!isDev && isClient) {
config.devtool = '#source-map'
config.plugins.push(
new BugsnagBuildReporterPlugin({
apiKey: 'XXX',
appVersion: process.env.RELEASE,
releaseStage: 'production'
})
)
config.plugins.push(
new BugsnagSourceMapUploaderPlugin({
apiKey: 'XXX',
appVersion: process.env.RELEASE,
releaseStage: 'production',
overwrite: true,
})
)
}
},
},
...
}
{
...
"scripts": {
"generate": "RELEASE=$(git rev-parse HEAD) nuxt generate && rm dist/**/*.map",
},
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment