Created
December 18, 2018 12:07
-
-
Save nicooprat/15a0c4f6a8396ba855e31b58aa4d323a to your computer and use it in GitHub Desktop.
Nuxt, Webpack & Bugsnag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
}) | |
) | |
} | |
}, | |
}, | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"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