I had added style.css.map
to my .gitignore
file thinking that this was some kind of internal file that was not needed for public consumption.
Now I'm seeing that when Chrome (not Firefox) loads my page, it is looking for style.css.map
and returning a 404. I'm not explicitly asking it to load that file, but it seems to be getting called automatically.
For further context, this is a Wordpress site and I am including the style.scss
file in the repo.
A “source map” is a special file that connects a minified/uglified version of an asset (CSS or JavaScript) to the original authored version. Say you've got a file called _header. scss that gets imported into global. scss which is compiled to global.
This is actually one of the easiest ways to increase your website performance. When you build your application for production, source maps are usually generated alongside your built files which are minified already. They hold the original sources of your code and helps in debugging your code live.
Removing CSS map files will not harm your application or make it work any differently. The same is true for JavaScript maps (i.e. . js. map ).
A source map is a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger.
For each generated CSS file, Sass is generating a source map file (.map file) in addition to the compiled CSS. Each CSS file contains an annotation that specifies the URL of its source map file, embedded in a special comment on the last line of the file:
/*# sourceMappingURL= */
More info about sourcemaps: https://developer.chrome.com/devtools/docs/css-preprocessors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With