From 5fa9c42af9051dfc2a43aaaedf51aded5a98bfc8 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Wed, 11 Dec 2024 16:08:50 +0530 Subject: [PATCH] chore: process env console --- webpack.common.js | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index 7fdb5608..51759491 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -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) { @@ -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",