Webpack Next.js Sentry Sourcemap大小太大
我正试图使用next.js的sourcemap功能来更好地调试sentry,但当我构建下一个应用程序时,它试图将大型sourcemap文件上传到sentry。有什么问题吗 另外,我的next.config.js配置如下Webpack Next.js Sentry Sourcemap大小太大,webpack,next.js,source-maps,sentry,vercel,Webpack,Next.js,Source Maps,Sentry,Vercel,我正试图使用next.js的sourcemap功能来更好地调试sentry,但当我构建下一个应用程序时,它试图将大型sourcemap文件上传到sentry。有什么问题吗 另外,我的next.config.js配置如下 const SentryWebpackPlugin = require('@sentry/webpack-plugin'); const withSourceMaps = require('@zeit/next-source-maps')(); webpack: (confi
const SentryWebpackPlugin = require('@sentry/webpack-plugin');
const withSourceMaps = require('@zeit/next-source-maps')();
webpack: (config, { dev, isServer, buildId }) => {
if (!isServer) {
config.resolve.alias['@sentry/node'] = '@sentry/browser';
}
if (process.env.NODE_ENV === 'production') {
config.plugins.push(
new SentryWebpackPlugin({
include: './app/.next',
ignore: ['node_modules'],
urlPrefix: '~/_next',
release: buildId,
}),
);
}
return config;}
*.css.map
和其他文件,所以不要上传它们
const SentryWebpackPlugin = require('@sentry/webpack-plugin');
...
module.exports = {
...
productionBrowserSourceMaps: process.env.NODE_ENV === 'production',
...
webpack: (config, { dev, isServer, buildId }) => {
if (!isServer) {
config.resolve.alias['@sentry/node'] = '@sentry/browser';
}
if (process.env.NODE_ENV === 'production') {
config.plugins.push(
new SentryWebpackPlugin({
include: './app/.next',
ignore: ['node_modules', '*.css.map'],
stripPrefix: ['webpack://_N_E/'],
urlPrefix: '~/_next',
release: buildId,
}),
);
}
return config;
}