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 MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
const SentryWebpackPlugin = require('@sentry/webpack-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, {
|
const webpackConfig = merge(baseWebpackConfig, {
|
||||||
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
|
|
@ -25,12 +37,7 @@ const webpackConfig = merge(baseWebpackConfig, {
|
||||||
minimizer: [new CssMinimizerPlugin()],
|
minimizer: [new CssMinimizerPlugin()],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new SentryWebpackPlugin({
|
...sentryPlugin,
|
||||||
org: 'iterativ',
|
|
||||||
project: 'skillbox-vue',
|
|
||||||
include: config.build.assetsRoot,
|
|
||||||
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
||||||
}),
|
|
||||||
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': env,
|
'process.env': env,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue