From 056b63efa0fe682a2afe57d0f65a2c56baaf181a Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Tue, 15 Jul 2025 13:03:34 +0200 Subject: [PATCH] Update webpack configuration to copy index.html to payment/success directory and change base URL in config.js to production URL. --- src/config.js | 2 +- webpack.config.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index df32320..eae36db 100644 --- a/src/config.js +++ b/src/config.js @@ -1,5 +1,5 @@ const config = { - baseUrl: "https://dev.seedheads.de", + baseUrl: "https://growheads.de", apiBaseUrl: "", googleClientId: "928121624463-jbgfdlgem22scs1k9c87ucg4ffvaik6o.apps.googleusercontent.com", stripePublishableKey: "pk_test_51R7lltRtpe3h1vwJzIrDb5bcEigTLBHrtqj9SiPX7FOEATSuD6oJmKc8xpNp49ShpGJZb2GShHIUqj4zlSIz4olj00ipOuOAnu", diff --git a/webpack.config.js b/webpack.config.js index 831a1c0..f7dc080 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -83,6 +83,21 @@ const CopyAssetsPlugin = { } catch (err) { console.error('Error copying favicon:', err); } + + // Copy index.html to payment/success directory for callback + const indexSrc = path.resolve(__dirname, 'dist/index.html'); + const paymentSuccessDir = path.resolve(__dirname, 'dist/payment/success'); + const paymentSuccessDest = path.resolve(__dirname, 'dist/payment/success/index.html'); + try { + // Create payment/success directory if it doesn't exist + if (!fs.existsSync(paymentSuccessDir)) { + fs.mkdirSync(paymentSuccessDir, { recursive: true }); + } + cpSync(indexSrc, paymentSuccessDest); + console.log('Index.html copied to payment/success successfully'); + } catch (err) { + console.error('Error copying index.html to payment/success:', err); + } }); }, };