Add workaround for webpack builds on platforms unsupported by Sentry

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/26904/head
Michael Telatynski 2024-01-19 19:53:52 +00:00
parent e5d0c2ae7b
commit 3867576137
No known key found for this signature in database
GPG Key ID: A2B008A5F49F5D0D
1 changed files with 4 additions and 3 deletions

View File

@ -8,7 +8,6 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TerserPlugin = require("terser-webpack-plugin"); const TerserPlugin = require("terser-webpack-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const HtmlWebpackInjectPreload = require("@principalstudio/html-webpack-inject-preload"); const HtmlWebpackInjectPreload = require("@principalstudio/html-webpack-inject-preload");
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
const crypto = require("crypto"); const crypto = require("crypto");
const CopyWebpackPlugin = require("copy-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin");
@ -707,9 +706,11 @@ module.exports = (env, argv) => {
files: [{ match: /.*Inter.*\.woff2$/ }], files: [{ match: /.*Inter.*\.woff2$/ }],
}), }),
// upload to sentry if sentry env is present // Upload to sentry if sentry env is present
// This plugin fails to import on some platforms like ppc64le & s390x even if the plugin isn't called,
// so we require it conditionally.
process.env.SENTRY_DSN && process.env.SENTRY_DSN &&
sentryWebpackPlugin({ require("@sentry/webpack-plugin").sentryWebpackPlugin({
release: process.env.VERSION, release: process.env.VERSION,
sourcemaps: { sourcemaps: {
paths: "./webapp/bundles/**", paths: "./webapp/bundles/**",