Add check for sentry token
This commit is contained in:
parent
8df4041c03
commit
b3a4045cca
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue