Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Added envLoggingUrl in webpack #294

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CopyPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const BundleAnalyzerPlugin =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");

const sdkEnv = process.env.sdkEnv;
const envSdkUrl = process.env.envSdkUrl;
const envBackendUrl = process.env.envBackendUrl;
const envLoggingUrl = process.env.envLoggingUrl;

//git rev-parse --abbrev-ref HEAD
let repoVersion = require("./package.json").version;
let majorVersion = "v" + repoVersion.split(".")[0];

let repoName = require("./package.json").name;
let repoPublicPath =
sdkEnv === "local" ? "" : `/${repoVersion}/${majorVersion}`;
let repoPublicPath = sdkEnv === "local" ? "" : `/${repoVersion}/${majorVersion}`;

let sdkUrl;

Expand Down Expand Up @@ -64,10 +63,15 @@ if (envBackendUrl === undefined) {
confirmEndPoint = envBackendUrl;
}

let logEndpoint =
sdkEnv === "prod"
? "https://api.hyperswitch.io/logs/sdk"
: "https://sandbox.hyperswitch.io/logs/sdk";
let logEndpoint;
if (envLoggingUrl === undefined) {
logEndpoint =
sdkEnv === "prod"
? "https://api.hyperswitch.io/logs/sdk"
: "https://sandbox.hyperswitch.io/logs/sdk";
} else {
logEndpoint = envLoggingUrl;
}

// Set this to true to enable logging
let enableLogging = true;
Expand Down
1 change: 1 addition & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let backendEndPoint =
let devServer = {
contentBase: path.join(__dirname, "dist"),
hot: true,
host: "0.0.0.0",
port: 9050,
historyApiFallback: true,
proxy: {
Expand Down
Loading