give
Last commit date
assets
2 years ago
blocks
2 years ago
build
2 years ago
includes
2 years ago
languages
2 years ago
sample-data
6 years ago
src
2 years ago
templates
2 years ago
vendor
2 years ago
LICENSE
2 years ago
give.php
2 years ago
license.txt
6 years ago
readme.txt
2 years ago
uninstall.php
2 years ago
wordpress-scripts-webpack.config.js
2 years ago
wpml-config.xml
6 years ago
wordpress-scripts-webpack.config.js
71 lines
| 1 | /** |
| 2 | * External Dependencies |
| 3 | */ |
| 4 | const path = require('path'); |
| 5 | |
| 6 | /** |
| 7 | * WordPress Dependencies |
| 8 | */ |
| 9 | const defaultConfig = require('@wordpress/scripts/config/webpack.config.js'); |
| 10 | |
| 11 | /** |
| 12 | * Custom config |
| 13 | */ |
| 14 | module.exports = { |
| 15 | ...defaultConfig, |
| 16 | resolve: { |
| 17 | ...defaultConfig.resolve, |
| 18 | alias: { |
| 19 | ...defaultConfig.resolve.alias, |
| 20 | '@givewp/forms/types': srcPath('DonationForms/resources/types.ts'), |
| 21 | '@givewp/forms/propTypes': srcPath('DonationForms/resources/propTypes.ts'), |
| 22 | '@givewp/forms/app': srcPath('DonationForms/resources/app'), |
| 23 | '@givewp/forms/registrars': srcPath('DonationForms/resources/registrars'), |
| 24 | '@givewp/forms/shared': srcPath('DonationForms/resources/shared'), |
| 25 | '@givewp/form-builder': srcPath('FormBuilder/resources/js/form-builder/src'), |
| 26 | '@givewp/form-builder/registrars': srcPath('FormBuilder/resources/js/registrars/index.ts'), |
| 27 | '@givewp/components': srcPath('Views/Components/'), |
| 28 | }, |
| 29 | }, |
| 30 | entry: { |
| 31 | donationFormBlock: srcPath('DonationForms/Blocks/DonationFormBlock/resources/block.ts'), |
| 32 | donationFormBlockApp: srcPath('DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx'), |
| 33 | donationFormApp: srcPath('DonationForms/resources/app/DonationFormApp.tsx'), |
| 34 | donationFormRegistrars: srcPath('DonationForms/resources/registrars/index.ts'), |
| 35 | donationFormEmbed: srcPath('DonationForms/resources/embed.ts'), |
| 36 | donationFormEmbedInside: srcPath('DonationForms/resources/embedInside.ts'), |
| 37 | stripePaymentElementGateway: srcPath( |
| 38 | 'PaymentGateways/Gateways/Stripe/StripePaymentElementGateway/stripePaymentElementGateway.tsx' |
| 39 | ), |
| 40 | stripePaymentElementFormBuilder: srcPath( |
| 41 | 'PaymentGateways/Gateways/Stripe/StripePaymentElementGateway/resources/js/index.tsx' |
| 42 | ), |
| 43 | testGateway: srcPath('PaymentGateways/Gateways/TestGateway/testGateway.tsx'), |
| 44 | testOffsiteGateway: srcPath('PaymentGateways/Gateways/TestOffsiteGateway/testOffsiteGateway.tsx'), |
| 45 | offlineGateway: srcPath('PaymentGateways/Gateways/Offline/resources/offlineGateway.tsx'), |
| 46 | offlineGatewayFormBuilder: srcPath('PaymentGateways/Gateways/Offline/resources/formBuilder/index.tsx'), |
| 47 | payPalStandardGateway: srcPath( |
| 48 | 'PaymentGateways/Gateways/PayPalStandard/resources/js/payPalStandardGateway.tsx' |
| 49 | ), |
| 50 | payPalCommerceGateway: srcPath('PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx'), |
| 51 | classicFormDesignCss: srcPath('DonationForms/FormDesigns/ClassicFormDesign/css/main.scss'), |
| 52 | classicFormDesignJs: srcPath('DonationForms/FormDesigns/ClassicFormDesign/js/main.ts'), |
| 53 | multiStepFormDesignCss: srcPath('DonationForms/FormDesigns/MultiStepFormDesign/css/main.scss'), |
| 54 | donationConfirmationReceiptApp: srcPath('DonationForms/resources/receipt/DonationConfirmationReceiptApp.tsx'), |
| 55 | baseFormDesignCss: srcPath('DonationForms/resources/styles/base.scss'), |
| 56 | formBuilderApp: srcPath('FormBuilder/resources/js/form-builder/src/index.tsx'), |
| 57 | formBuilderRegistrars: srcPath('FormBuilder/resources/js/registrars/index.ts'), |
| 58 | adminBlocks: path.resolve(process.cwd(), 'blocks', 'load.js'), |
| 59 | }, |
| 60 | }; |
| 61 | |
| 62 | /** |
| 63 | * Helper for getting the path to the src directory. |
| 64 | * |
| 65 | * @param {string} relativePath |
| 66 | * @returns {string} |
| 67 | */ |
| 68 | function srcPath(relativePath) { |
| 69 | return path.resolve(process.cwd(), 'src', relativePath); |
| 70 | } |
| 71 |