-------- Original Message --------
Subject: Re: Make the file property useful
From: Brian Slesinsky <skyb...@google.com>
To: Simon Lydell <simon....@gmail.com>
CC:
If the sourcemap points to the JavaSc ript then you can't move the JavaScript. For example, developers using a common library could download the JavaScript and ship it with their apps while leaving the sourcemap (and source code) in a common location, so it doesn't need to be included.
On Feb 6, 2014 11:10 PM, "Simon Lydell" <simon....@gmail.com> wrote:
The file property is described as:
> An optional name of the generated code that this source map is associated with.
I don't understand how that is useful. I propose:
A required path to the generated code that this source map is associated with, relative to the source map itself. (It should _not_ be joined with the sourceRoot.)
One could argue that that is redundant, since browsers get the source map from the generated code. But what if you don't:
It would be useful to (command line) tools working with source maps, giving a better user experience. Currently there are a few ways to go:
1. Ask for the generated code, hope for a sourceMappingURL comment, parse it out and get the source map. Works pretty good.
2. Ask for both the generated code and the source map. Annoying for the user.
3. Guess that the source map is placed next to the generated file and called <filename>.map. Usually true and sane, but not always.
4. Only take the source map and hope for a useful file property. This is what the [mozilla/source-map] module does in its [.applySourceMap()] method.
It would be nice to have a standardized way to just ask for the source map, easily read the file property (it's just JSON) and as such being able to get the get generated code.
[mozilla/source-map]: https://github.com/mozilla/source-map
[.applySourceMap()]: https://github.com/mozilla/source-map#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile
_______________________________________________
dev-js-sourcemap mailing list
dev-js-s...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-js-sourcemap
-------- Original Message --------
Subject: Re: Make the file property useful
From: Simon Lydell <simon....@gmail.com>
To: Brian Slesinsky <skyb...@google.com>
CC:
Ah, that's true. Good point.
Then what use is it? Is it better to get rid of the property altogether?