Answer the question
In order to leave comments, you need to log in
Why doesn't Sentry work after webpack build?
My project uses webpack v3.7.1, with the following settings:
const merge = require('webpack-merge');
const SentryCliPlugin = require('@sentry/webpack-plugin');
let config = {
// подключение других менее критичных настроек...
output: {
path: path.join(__dirname, 'dist'),
filename: "./js/[name].js",
sourceMapFilename: "./js/[name].js.map"
},
devtool: 'source-map',
plugins: [
new SentryWebpackPlugin({
include: '.',
ignoreFile: '.sentrycliignore',
ignore: ['node_modules', 'webpack.config.js'],
configFile: 'sentry.properties'
})
],
};
module.exports (env) = {
// подключение других менее критичных настроек...
if (env.production) {
config = merge(config, {
plugins: [
new UglifyJSPlugin({
sourceMap: true,
beautify: false,
comments: false,
compress: {
sequences: true,
booleans: true,
loops: true,
unused: true,
warnings: false,
drop_console: false,
unsafe: true
}
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
})
]
});
}
if (env.development) {
config = merge(config, {
devServer: {
contentBase: `../${dist.root}`,
watchContentBase: true,
openPage: '/pages-list.html',
open: true,
port: '3003'
}
});
}
};
import * as Sentry from '@sentry/browser';
Sentry.init(Object.assign({
dsn: 'self_hosted_sentry_url',
environment: 'development', // соответственно для продакшена - 'production'
integrations: [
new Sentry.Integrations.Vue({ Vue })
]
}, config));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question