Closed LeraAtwater closed 11 months ago
Confirmed this bug via uswds/uswds-sandbox repo.
The CSSO plugin (postcss-csso
) combined with writing map to a file seems to be causing the incorrect paths.
Workarounds
521KB → 552KB
].521KB → 1.9MB
]. Full table
Build task | CSS size | Build time | Paths fixed |
---|---|---|---|
Defaults | 521KB | 4.73s | ❌ |
CSSO with forceMediaMerge | 505KB | 4.64s | n/a |
CSSO + SASS compressed | 521KB | 4.57s | ✅ |
SASS, no compression. CSSO Disabled. | 723KB | 3.91s | ✅ |
SASS compressed | 552KB | 3.9s | ✅ |
Other things I've tried
base
SASS directory after gulp.src paths.sourcemaps.write()
.
Describe the bug
Sourcemaps are compiled correctly and display in the browser inspection tool. However, the directory it points to is incorrect.
For example, the sass files are located at: /custom/samhsa_data/sass/partial/_home-page2.scss
The sourcemap describes the location as: /custom/samhsa_data/css/partial/_home-page2.scss
The /css directory is the location for compiled style on this site, there are no sass files anywhere in that directory.
Steps to reproduce the bug
Expected Behavior
Sourcemap should accurately reflect which directory the sass files come from
Related code
Gulpfile for this project-- nothing special going on outside the defaults
Screenshots
Wrong path displayed in browser dev tool:
System setup
USWDS compile version: 1.0 USWDS version: 3.5 Mac OS (Ventura) Chrome browser, latest version
Additional context
No response
Code of Conduct