Description
I had a look at https://github.com/mozilla/source-map/blob/master/CONTRIBUTING.md#filing-issues but couldn't find any guidelines for simply asking questions. I'll try to be as thorough as I can.
I've been looking at the following:
- sass-loader: https://github.com/webpack-contrib/sass-loader/blob/2529c0716b1bca321c22d16636b1385682b1c730/lib/loader.js#L85-L94
- postcss-loader: https://github.com/postcss/postcss-loader/blob/44167910d13fea32208989ffb31406f9577baf28/lib/index.js#L155-L157
- css-loader: https://github.com/webpack-contrib/css-loader/blob/8897d446c88eb7a6585a7954ae8766a7242c12da/lib/loader.js#L118-L130
- style-loader: https://github.com/webpack-contrib/style-loader/tree/c7d8fecb8ccaa29bd961d560a518267f763e74ba
In trying to determine why it is so difficult to get source maps to work in an expected way with webpack, I noticed a few things about some of these node packages. I'd like to confirm that I understand how source maps work before I open up issues in these repos or attempt putting the time into creating pull requests of my own for them.
Basically, I don't want to criticize someone else if I might be wrong.
My reference is: Source Map Revision 3 Proposal
Question 1: Types for sourceRoot
and sources
Can you confirm that both the sourceRoot
string and sources
array are intended to contain URLs, and NOT file system paths (POSIX, Windows, or otherwise)? If not, what am I missing?
Question 2: Is sourceRoot
optional? Always?
- Is
sourceRoot
being undefined or an empty string, valid? It just means that nothing is prepended tosources
, correct? - No plugin/module/software working with source maps should define this field if the developer left it empty, correct?
Question 3: Is null
a valid value for sourceRoot
?
For my own reference. Is it treated the same as being undefined?
Question 4: Is file
intended to be just the file name?
Meaning no path information. Just the name and extension.
Question 5: Is there a central registry for extensions?
Extra properties on a map whose property names begin with x_
.
Primarily, I intend to dive deeper into sass-loader and postcss-loader as they seem to be using file system paths instead of URLs, and that could be the source of some of the problems I'm running into.
I'm trying to contribute to: webpack-contrib/css-loader#652 (comment), which I don't have enough information to do properly and my existing post is not as well informed as I'd like it to be.