Commit 373425a
authored
Prevent non-reproducible Sass/CSS builds. (#76098)
This adds `sourceMap: false` to `sassPlugin` calls to prevent scenarios where CSS builds are inconsistent and non-reproducible due to the fact that `esbuild-sass-plugin` uses absolute paths when creating the `sourceMappingURLs` included in generated CSS.
The `wp-build` package creates a hash of each CSS file to serve as a value of the `data-wp-hash` attribute. While `/*# sourceMappingURL=... */` is stripped out of the built CSS files, this is handled by `postcss` after the hash is generated from the file's contents.
Instead of relying on `postcss` to strip source maps out at the end, `sourceMap: false` ensures it's never included. This results in consistent hash generation when the file contents are unchanged regardless of where the repository is cloned or which operating system is being used.1 parent 535405a commit 373425a
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
| |||
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
| 241 | + | |
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
| |||
0 commit comments