Skip to content

Commit

Permalink
chore: process env console
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja committed Dec 11, 2024
1 parent a571a2a commit 5fa9c42
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const getSdkUrl = (env, customUrl) => {
return urls[env] || urls.local;
};

console.log("env", process.env);

const sdkUrl = getSdkUrl(sdkEnv, envSdkUrl);
const getEnvironmentDomain = (prodDomain, integDomain, defaultDomain) => {
switch (sdkEnv) {
Expand Down Expand Up @@ -67,25 +69,28 @@ module.exports = (publicPath = "auto") => {
app: "./index.js",
HyperLoader: "./src/hyper-loader/HyperLoader.bs.js",
};
let definePluginValues = {
repoName: JSON.stringify(repoName),
repoVersion: JSON.stringify(repoVersion),
publicPath: JSON.stringify(repoPublicPath),
sdkUrl: JSON.stringify(sdkUrl),
backendEndPoint: JSON.stringify(backendEndPoint),
confirmEndPoint: JSON.stringify(confirmEndPoint),
logEndpoint: JSON.stringify(logEndpoint),
sentryDSN: JSON.stringify(process.env.SENTRY_DSN),
sentryScriptUrl: JSON.stringify(process.env.SENTRY_SCRIPT_URL),
enableLogging: ENABLE_LOGGING,
loggingLevel: JSON.stringify(loggingLevel),
maxLogsPushedPerEventName: JSON.stringify(maxLogsPushedPerEventName),
};
console.log("definePluginValues", definePluginValues);

const plugins = [
new MiniCssExtractPlugin(),
new CopyPlugin({
patterns: [{ from: "public" }],
}),
new webpack.DefinePlugin({
repoName: JSON.stringify(repoName),
repoVersion: JSON.stringify(repoVersion),
publicPath: JSON.stringify(repoPublicPath),
sdkUrl: JSON.stringify(sdkUrl),
backendEndPoint: JSON.stringify(backendEndPoint),
confirmEndPoint: JSON.stringify(confirmEndPoint),
logEndpoint: JSON.stringify(logEndpoint),
sentryDSN: JSON.stringify(process.env.SENTRY_DSN),
sentryScriptUrl: JSON.stringify(process.env.SENTRY_SCRIPT_URL),
enableLogging: ENABLE_LOGGING,
loggingLevel: JSON.stringify(loggingLevel),
maxLogsPushedPerEventName: JSON.stringify(maxLogsPushedPerEventName),
}),
new webpack.DefinePlugin(definePluginValues),
new HtmlWebpackPlugin({
inject: false,
template: "./public/build.html",
Expand Down

0 comments on commit 5fa9c42

Please sign in to comment.