Magentix

Développeur Magento indépendant depuis 2009

Billets : Une installation légère de Magento 2


Une installation légère de Magento 2

Magento 2 est proposé de base avec un nombre de modules extrêmement élevé. Pour de nombreux sites e-commerce il y en a finalement beaucoup trop. Voici comment obtenir une installation plus légère.

Avec le temps Magento s'alourdit. Les nouvelles releases proposent systématiquement de nouvelles fonctionnalités. Mais pour beaucoup de sites e-commerce elles ne sont pas toujours justifiées et alourdissent inutilement le code. Et moins il y en a, mieux c'est.

Si vous souhaitez lancer un simple e-commerce avec l'essentiel des fonctionnalités (tout en bénéficiant de la richesse de l'écosystème Magento) un peu de ménage s'impose.

Composer permet d'ignorer un paquet enfant si vous estimez qu'un autre peut le remplacer. Dans notre cas nous les ignorons simplement.

Ce replace est inspiré de celui proposé par yireo : yireo/magento2-replace-all. Je l'ai enrichi avec d'autres modules non indispensables pour une installation basique (two-factor-auth, login-as-customer, re-captcha...).

Il a été testé avec succès sur Magento Open-Source 2.4.2. À adapter selon vos besoins (on se rapproche ici des mêmes features de base d'un Magento 1.9).

Note : sur un site déjà en place une recette minutieuse est indispensable car aucune vérification sur les dépendances des modules spécifiques (app/code) n'est effectuée.

Ajoutez le noeud replace au fichier composer.json à la racine avant d'exécuter un composer install.

Mises à jour :

{
    "replace": {
        "amzn/amazon-pay-and-login-magento-2-module": "*",
        "amzn/amazon-pay-and-login-with-amazon-core-module": "*",
        "amzn/amazon-pay-module": "*",
        "amzn/amazon-pay-sdk-php": "*",
        "amzn/login-with-amazon-module": "*",
        "astock/stock-api-libphp": "*",
        "braintree/braintree": "*",
        "braintree/braintree_php": "*",
        "dotmailer/dotmailer-magento2-extension": "*",
        "dotmailer/dotmailer-magento2-extension-b2b": "*",
        "dotmailer/dotmailer-magento2-extension-chat": "*",
        "dotmailer/dotmailer-magento2-extension-enterprise": "*",
        "dotmailer/dotmailer-magento2-extension-package": "*",
        "klarna/m2-payments": "*",
        "klarna/module-core": "*",
        "klarna/module-kp": "*",
        "klarna/module-kp-graph-ql": "*",
        "klarna/module-onsitemessaging": "*",
        "klarna/module-ordermanagement": "*",
        "magento/adobe-stock-integration": "*",
        "magento/google-shopping-ads": "*",
        "magento/inventory-composer-installer": "*",
        "magento/inventory-composer-metapackage": "*",
        "magento/inventory-metapackage": "*",
        "magento/language-de_de": "*",
        "magento/language-es_es": "*",
        "magento/language-nl_nl": "*",
        "magento/language-pt_br": "*",
        "magento/language-zh_hans_cn": "*",
        "magento/module-admin-analytics": "*",
        "magento/module-adobe-ims": "*",
        "magento/module-adobe-ims-api": "*",
        "magento/module-adobe-stock-admin-ui": "*",
        "magento/module-adobe-stock-asset": "*",
        "magento/module-adobe-stock-asset-api": "*",
        "magento/module-adobe-stock-client": "*",
        "magento/module-adobe-stock-client-api": "*",
        "magento/module-adobe-stock-image": "*",
        "magento/module-adobe-stock-image-admin-ui": "*",
        "magento/module-adobe-stock-image-api": "*",
        "magento/module-advanced-pricing-import-export": "*",
        "magento/module-amqp": "*",
        "magento/module-amqp-store": "*",
        "magento/module-analytics": "*",
        "magento/module-authorizenet": "*",
        "magento/module-authorizenet-acceptjs": "*",
        "magento/module-authorizenet-cardinal": "*",
        "magento/module-authorizenet-graph-ql": "*",
        "magento/module-aws-s3": "*",
        "magento/module-braintree": "*",
        "magento/module-braintree-graph-ql": "*",
        "magento/module-bundle-graph-ql": "*",
        "magento/module-bundle-import-export": "*",
        "magento/module-bundle-import-export-staging": "*",
        "magento/module-bundle-sample-data": "*",
        "magento/module-bundle-staging": "*",
        "magento/module-cardinal-commerce": "*",
        "magento/module-catalog-analytics": "*",
        "magento/module-catalog-cms-graph-ql": "*",
        "magento/module-catalog-customer-graph-ql": "*",
        "magento/module-catalog-customer-ql": "*",
        "magento/module-catalog-graph-ql": "*",
        "magento/module-catalog-import-export-staging": "*",
        "magento/module-catalog-inventory-graph-ql": "*",
        "magento/module-catalog-inventory-staging": "*",
        "magento/module-catalog-page-builder-analytics-staging": "*",
        "magento/module-catalog-rule-sample-data": "*",
        "magento/module-catalog-rule-staging": "*",
        "magento/module-catalog-rule-graph-ql": "*",
        "magento/module-catalog-sample-data": "*",
        "magento/module-catalog-staging": "*",
        "magento/module-catalog-staging-page-builder": "*",
        "magento/module-catalog-url-rewrite-graph-ql": "*",
        "magento/module-catalog-url-rewrite-staging": "*",
        "magento/module-checkout-agreements-graph-ql": "*",
        "magento/module-checkout-staging": "*",
        "magento/module-cms-graph-ql": "*",
        "magento/module-cms-page-builder-analytics-staging": "*",
        "magento/module-cms-sample-data": "*",
        "magento/module-cms-staging": "*",
        "magento/module-cms-url-rewrite-graph-ql": "*",
        "magento/module-configurable-product-graph-ql": "*",
        "magento/module-configurable-product-staging": "*",
        "magento/module-configurable-sample-data": "*",
        "magento/module-compare-list-graph-ql": "*",
        "magento/module-customer-analytics": "*",
        "magento/module-customer-balance-graph-ql": "*",
        "magento/module-customer-downloadable-graph-ql": "*",
        "magento/module-customer-graph-ql": "*",
        "magento/module-customer-import-export": "*",
        "magento/module-customer-sample-data": "*",
        "magento/module-csp": "*",
        "magento/module-cybersource": "*",
        "magento/module-dhl": "*",
        "magento/module-directory-graph-ql": "*",
        "magento/module-downloadable-graph-ql": "*",
        "magento/module-downloadable-import-export": "*",
        "magento/module-downloadable-sample-data": "*",
        "magento/module-downloadable-staging": "*",
        "magento/module-eav-graph-ql": "*",
        "magento/module-eway": "*",
        "magento/module-fedex": "*",
        "magento/module-gift-card-account-graph-ql": "*",
        "magento/module-gift-card-graph-ql": "*",
        "magento/module-gift-card-staging": "*",
        "magento/module-gift-message-staging": "*",
        "magento/module-gift-wrapping-staging": "*",
        "magento/module-gift-message-graph-ql": "*",
        "magento/module-google-adwords": "*",
        "magento/module-google-optimizer": "*",
        "magento/module-google-optimizer-staging": "*",
        "magento/module-graph-ql": "*",
        "magento/module-graph-ql-cache": "*",
        "magento/module-grouped-import-export": "*",
        "magento/module-grouped-product-graph-ql": "*",
        "magento/module-grouped-product-sample-data": "*",
        "magento/module-grouped-product-staging": "*",
        "magento/module-inventory": "*",
        "magento/module-inventory-admin-ui": "*",
        "magento/module-inventory-advanced-checkout": "*",
        "magento/module-inventory-api": "*",
        "magento/module-inventory-bundle-import-export": "*",
        "magento/module-inventory-bundle-product": "*",
        "magento/module-inventory-bundle-product-admin-ui": "*",
        "magento/module-inventory-bundle-product-indexer": "*",
        "magento/module-inventory-cache": "*",
        "magento/module-inventory-catalog": "*",
        "magento/module-inventory-catalog-admin-ui": "*",
        "magento/module-inventory-catalog-api": "*",
        "magento/module-inventory-catalog-frontend-ui": "*",
        "magento/module-inventory-catalog-search": "*",
        "magento/module-inventory-configurable-product": "*",
        "magento/module-inventory-configurable-product-admin-ui": "*",
        "magento/module-inventory-configurable-product-frontend-ui": "*",
        "magento/module-inventory-configurable-product-indexer": "*",
        "magento/module-inventory-configuration": "*",
        "magento/module-inventory-configuration-api": "*",
        "magento/module-inventory-distance-based-source-selection": "*",
        "magento/module-inventory-distance-based-source-selection-admin-ui": "*",
        "magento/module-inventory-distance-based-source-selection-api": "*",
        "magento/module-inventory-elasticsearch": "*",
        "magento/module-inventory-export-stock": "*",
        "magento/module-inventory-export-stock-api": "*",
        "magento/module-inventory-graph-ql": "*",
        "magento/module-inventory-grouped-product": "*",
        "magento/module-inventory-grouped-product-admin-ui": "*",
        "magento/module-inventory-grouped-product-indexer": "*",
        "magento/module-inventory-import-export": "*",
        "magento/module-inventory-in-store-pickup": "*",
        "magento/module-inventory-in-store-pickup-admin-ui": "*",
        "magento/module-inventory-in-store-pickup-api": "*",
        "magento/module-inventory-in-store-pickup-frontend": "*",
        "magento/module-inventory-in-store-pickup-graph-ql": "*",
        "magento/module-inventory-in-store-pickup-multishipping": "*",
        "magento/module-inventory-in-store-pickup-quote": "*",
        "magento/module-inventory-in-store-pickup-quote-graph-ql": "*",
        "magento/module-inventory-in-store-pickup-sales": "*",
        "magento/module-inventory-in-store-pickup-sales-admin-ui": "*",
        "magento/module-inventory-in-store-pickup-sales-api": "*",
        "magento/module-inventory-in-store-pickup-shipping": "*",
        "magento/module-inventory-in-store-pickup-shipping-admin-ui": "*",
        "magento/module-inventory-in-store-pickup-shipping-api": "*",
        "magento/module-inventory-in-store-pickup-webapi-extension": "*",
        "magento/module-inventory-indexer": "*",
        "magento/module-inventory-low-quantity-notification": "*",
        "magento/module-inventory-low-quantity-notification-admin-ui": "*",
        "magento/module-inventory-low-quantity-notification-api": "*",
        "magento/module-inventory-multi-dimensional-indexer-api": "*",
        "magento/module-inventory-product-alert": "*",
        "magento/module-inventory-requisition-list": "*",
        "magento/module-inventory-reservation-cli": "*",
        "magento/module-inventory-reservations": "*",
        "magento/module-inventory-reservations-api": "*",
        "magento/module-inventory-sales": "*",
        "magento/module-inventory-sales-admin-ui": "*",
        "magento/module-inventory-sales-api": "*",
        "magento/module-inventory-sales-frontend-ui": "*",
        "magento/module-inventory-setup-fixture-generator": "*",
        "magento/module-inventory-shipping": "*",
        "magento/module-inventory-shipping-admin-ui": "*",
        "magento/module-inventory-source-deduction-api": "*",
        "magento/module-inventory-source-selection": "*",
        "magento/module-inventory-source-selection-api": "*",
        "magento/module-inventory-swatches-frontend-ui": "*",
        "magento/module-inventory-visual-merchandiser": "*",
        "magento/module-inventory-wishlist": "*",
        "magento/module-layered-navigation-staging": "*",
        "magento/module-login-as-customer-graph-ql": "*",
        "magento/module-login-as-customer": "*",
        "magento/module-login-as-customer-admin-ui": "*",
        "magento/module-login-as-customer-api": "*",
        "magento/module-login-as-customer-assistance": "*",
        "magento/module-login-as-customer-frontend-ui": "*",
        "magento/module-login-as-customer-log": "*",
        "magento/module-login-as-customer-page-cache": "*",
        "magento/module-login-as-customer-quote": "*",
        "magento/module-login-as-customer-sales": "*",
        "magento/module-marketplace": "*",
        "magento/module-media-content": "*",
        "magento/module-media-content-api": "*",
        "magento/module-media-content-catalog": "*",
        "magento/module-media-content-cms": "*",
        "magento/module-media-gallery-ui": "*",
        "magento/module-media-gallery-ui-api": "*",
        "magento/module-media-gallery-integration": "*",
        "magento/module-media-gallery-synchronization": "*",
        "magento/module-media-gallery-synchronization-api": "*",
        "magento/module-media-content-synchronization": "*",
        "magento/module-media-content-synchronization-api": "*",
        "magento/module-media-content-synchronization-catalog": "*",
        "magento/module-media-content-synchronization-cms": "*",
        "magento/module-media-gallery-synchronization-metadata": "*",
        "magento/module-media-gallery-metadata": "*",
        "magento/module-media-gallery-metadata-api": "*",
        "magento/module-media-gallery-catalog-ui": "*",
        "magento/module-media-gallery-cms-ui": "*",
        "magento/module-media-gallery-catalog-integration": "*",
        "magento/module-media-gallery-catalog": "*",
        "magento/module-media-gallery-renditions": "*",
        "magento/module-media-gallery-renditions-api": "*",
        "magento/module-msrp-sample-data": "*",
        "magento/module-msrp-staging": "*",
        "magento/module-multishipping": "*",
        "magento/module-new-relic-reporting": "*",
        "magento/module-newsletter-graph-ql": "*",
        "magento/module-offline-shipping-sample-data": "*",
        "magento/module-payment-staging": "*",
        "magento/module-paypal-captcha": "*",
        "magento/module-paypal-graph-ql": "*",
        "magento/module-product-links-sample-data": "*",
        "magento/module-product-video-staging": "*",
        "magento/module-quote-analytics": "*",
        "magento/module-quote-graph-ql": "*",
        "magento/module-related-product-graph-ql": "*",
        "magento/module-release-notification": "*",
        "magento/module-review-analytics": "*",
        "magento/module-review-graph-ql": "*",
        "magento/module-review-sample-data": "*",
        "magento/module-review-staging": "*",
        "magento/module-reward-graph-ql": "*",
        "magento/module-reward-staging": "*",
        "magento/module-re-captcha-admin-ui": "*",
        "magento/module-re-captcha-checkout": "*",
        "magento/module-re-captcha-contact": "*",
        "magento/module-re-captcha-customer": "*",
        "magento/module-re-captcha-frontend-ui": "*",
        "magento/module-re-captcha-migration": "*",
        "magento/module-re-captcha-newsletter": "*",
        "magento/module-re-captcha-paypal": "*",
        "magento/module-re-captcha-review": "*",
        "magento/module-re-captcha-send-friend": "*",
        "magento/module-re-captcha-ui": "*",
        "magento/module-re-captcha-user": "*",
        "magento/module-re-captcha-validation": "*",
        "magento/module-re-captcha-validation-api": "*",
        "magento/module-re-captcha-version-2-checkbox": "*",
        "magento/module-re-captcha-version-2-invisible": "*",
        "magento/module-re-captcha-version-3-invisible": "*",
        "magento/module-rma-graph-ql": "*",
        "magento/module-rma-staging": "*",
        "magento/module-sales-analytics": "*",
        "magento/module-sales-graph-ql": "*",
        "magento/module-sales-rule-sample-data": "*",
        "magento/module-sales-rule-staging": "*",
        "magento/module-sales-sample-data": "*",
        "magento/module-sample-data": "*",
        "magento/module-search-staging": "*",
        "magento/module-securitytxt": "*",
        "magento/module-send-friend": "*",
        "magento/module-send-friend-graph-ql": "*",
        "magento/module-signifyd": "*",
        "magento/module-staging": "*",
        "magento/module-staging-page-builder": "*",
        "magento/module-store-graph-ql": "*",
        "magento/module-swagger": "*",
        "magento/module-swagger-webapi": "*",
        "magento/module-swagger-webapi-async": "*",
        "magento/module-swatches-graph-ql": "*",
        "magento/module-swatches-sample-data": "*",
        "magento/module-tax-graph-ql": "*",
        "magento/module-tax-import-export": "*",
        "magento/module-tax-sample-data": "*",
        "magento/module-theme-graph-ql": "*",
        "magento/module-theme-sample-data": "*",
        "magento/module-two-factor-auth": "*",
        "magento/module-ups": "*",
        "magento/module-url-rewrite-graph-ql": "*",
        "magento/module-usps": "*",
        "magento/module-vault-graph-ql": "*",
        "magento/module-version": "*",
        "magento/module-weee-graph-ql": "*",
        "magento/module-weee-staging": "*",
        "magento/module-widget-sample-data": "*",
        "magento/module-wishlist-analytics": "*",
        "magento/module-wishlist-graph-ql": "*",
        "magento/module-wishlist-sample-data": "*",
        "magento/module-worldpay": "*",
        "magento/sample-data-media": "*",
        "paypal/module-braintree": "*",
        "paypal/module-braintree-core": "*",
        "paypal/module-braintree-graph-ql": "*",
        "temando/module-shipping": "*",
        "temando/module-shipping-m2": "*",
        "temando/module-shipping-remover": "*",
        "vertex/module-address-validation": "*",
        "vertex/module-address-validation-api": "*",
        "vertex/module-tax": "*",
        "vertex/product-magento-module": "*",
        "vertex/sdk": "*",
        "yotpo/magento2-module-yotpo-reviews": "*",
        "yotpo/magento2-module-yotpo-reviews-bundle": "*"
    },
}