Skip to content

Static content is deploying for disabled modules #24666

Closed
@shkodasv

Description

Summary (*)

  • Original summary from the reporter :

I disable module output for several modules (e.g Checkout, GiftRegestry) and would like to know how to exclude CSS related to these modules from styles-l/styles-m files? As I don't need to load extra CSS

Preconditions (*)

  • reproduced on 2.3-develop

Steps to reproduce (*)

  1. Setup vanilla 2.3-develop installation
  2. Take a look at the file app/design/frontend/Magento/blank/Magento_Braintree/web/css/source/_module.less, notice the selector .payment-method-braintree is in there and also notice this selector is in no other file in the Magento source code except for this file in the Magento_Braintree module in the
    Magento/Blank theme.
  3. Now disable that module (and its dependency): bin/magento module:disable Magento_Braintree Magento_BraintreeGraphQl
  4. Remove potential left over files: rm -R var/view_preprocessed/* pub/static/*
  5. Run static content deploy: bin/magento setup:static-content:deploy -f --theme Magento/blank en_US
  6. Look at the generated file pub/static/frontend/Magento/blank/en_US/css/styles-m.css

Expected result (*)

  • Not finding a reference to the selector .payment-method-braintree

Actual result (*)

  • Finding references to the selector .payment-method-braintree

Update: In hindsight, @shkodasv is talking about the deprecated "disabling module output" feature of Magento which was removed in Magento 2.2 I believe. But the issue is still valid for disabled modules as well, or should we open a new issue then?

Metadata

Assignees

Labels

Area: UI FrameworkComponent: CssComponent: DeployIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.Triage: DoneHas been reviewed and prioritized during Triage with Product Managers

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions