Commit 25fe1c86 authored by 郭志伟's avatar 郭志伟

feat: sentry添加sourcemap上报

parent 2988c71c
const pkgInfo = require('./package.json');
const project = pkgInfo.name;
module.exports = {
org: 'sentry',
project,
authToken: '3f1f6f3789594e3a81280c1cd8d4d1008037a7abad714698b60b6f358c3d7562',
url: 'http://newsentry.quantgroups.com',
release: `${project}@1.0.0`,
ignore: ['node_modules', 'tests'],
silent: true,
include: [
{
paths: ['./dist'],
},
],
};
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
import ThemeColorReplacer from 'webpack-theme-color-replacer'; import ThemeColorReplacer from 'webpack-theme-color-replacer';
import generate from '@ant-design/colors/lib/generate'; import generate from '@ant-design/colors/lib/generate';
import path from 'path'; import path from 'path';
const SentryPlugin = require('@qg/sentry-webpack-plugin');
const SentryConfig = require('../.sentryclirc');
function getModulePackageName(module) { function getModulePackageName(module) {
if (!module.context) return null; if (!module.context) return null;
const nodeModulesPath = path.join(__dirname, '../node_modules/'); const nodeModulesPath = path.join(__dirname, '../node_modules/');
...@@ -27,6 +28,9 @@ function getModulePackageName(module) { ...@@ -27,6 +28,9 @@ function getModulePackageName(module) {
} }
export default config => { export default config => {
if (process.env.NODE_ENV === 'production') {
config.plugin('sentry-webpack-plugin').use(SentryPlugin, [SentryConfig]);
}
// preview.pro.ant.design only do not use in your production; // preview.pro.ant.design only do not use in your production;
if ( if (
process.env.ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site' || process.env.ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site' ||
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment