Update webpack configuration to copy index.html to payment/success directory and change base URL in config.js to production URL.
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user