Skip to content

Grunt Less uses pub/ prefix for sourcemaps #38837

@gwharton

Description

@gwharton

Summary

When using grunt to generate css, the associated sourcemaps use the prefix pub/ on all urls it generates. This forces the webserver config to employ a workaround to allow pub/ urls to continue to work, just for the sourcemaps. Sourcemaps should not use the pub/ prefix.

Examples

Deploy Vanilla 2.4.7-p1

cp Gruntfile.js.sample Gruntfile.js
php bin/magento deploy:mode:set development
grunt clean
grunt exec
grunt less
less pub/static/frontend/Magento/luma/en_US/css/styles-l.css.map

Observe the paths include pub/static

Browse to the frontend and inspect an element in the dev console.
Check the location of the less file obtained via the sourcemap

vDLOkBHE70

Although this will still work if your nginx config includes the following snippet

https://github.com/magento/magento2/blob/91cb4d46834b88bb8dc9f5b06279a63d9ad0963c/nginx.conf.sample#L98C1-L104C2

But isn't the use of /pub/ urls now unsupported?

Proposed solution

No response

Release note

less/css sourcemaps generated by grunt no longer use the /pub prefix for paths.

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Area: UI FrameworkComponent: UiIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions