Add check for sentry token

This commit is contained in:
Ramon Wenger 2023-03-30 22:21:19 +02:00
parent 8df4041c03
commit b3a4045cca
1 changed files with 13 additions and 6 deletions

View File

@ -13,6 +13,18 @@ const env = require('../config/prod.env');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const SentryWebpackPlugin = require('@sentry/webpack-plugin');
const sentryPlugin = [];
if (process.env.SENTRY_AUTH_TOKEN) {
sentryPlugin.push(
new SentryWebpackPlugin({
org: 'iterativ',
project: 'skillbox-vue',
include: config.build.assetsRoot,
authToken: process.env.SENTRY_AUTH_TOKEN,
})
);
}
const webpackConfig = merge(baseWebpackConfig, {
devtool: config.build.productionSourceMap ? config.build.devtool : false,
mode: 'production',
@ -25,12 +37,7 @@ const webpackConfig = merge(baseWebpackConfig, {
minimizer: [new CssMinimizerPlugin()],
},
plugins: [
new SentryWebpackPlugin({
org: 'iterativ',
project: 'skillbox-vue',
include: config.build.assetsRoot,
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
...sentryPlugin,
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env,