Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Add support for many to many

29 views
Skip to first unread message

sande...@gmail.com

unread,
Oct 20, 2014, 2:42:14 AM10/20/14
to mozilla-dev-...@lists.mozilla.org
Currently I'm building a library called React Style which allows you to write CSS inside JavaScript (inside React components to be more specific). For this library I want to combine everything in a bundled JS and bundled CSS file at build time, and with source maps I want to wrap everything back into separate files again that combine both CSS and JS. If I'm correct this not possible with the V3 spec of source maps as it's only possible to use 1 files as input for a source-map.

It would be great if there was support for many-to-many, instead of one-to-many. And preferably possible to mix CSS, JS, and even HTML.

I'm not sure what the current status of the spec is, and if there is even a V4 already - which might support what I want.

Conrad Irwin

unread,
Oct 20, 2014, 12:28:31 PM10/20/14
to sande...@gmail.com, mozilla-dev-...@lists.mozilla.org
I think what you want/need to do is to create one source map for each
output file.

Conrad
> _______________________________________________
> dev-js-sourcemap mailing list
> dev-js-s...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-js-sourcemap
>

Sander Spies

unread,
Oct 20, 2014, 12:48:46 PM10/20/14
to Conrad Irwin, mozilla-dev-...@lists.mozilla.org
Is it even possible to reference to a sourcemap file from another
sourcemap? I looked for it, but couldn't find anything.

Brian Slesinsky

unread,
Oct 20, 2014, 1:01:30 PM10/20/14
to Sander Spies, Conrad Irwin, mozilla-dev-...@lists.mozilla.org
When bundling multiple files together, you need to merge multiple
sourcemaps into one. There is support in the standard for multi-level
mappings, or you could just flatten it into a single sourcemap.

When splitting a bundle into multiple files, you will need to split the
sourcemap as well. There's no explicit support for this but it should be
possible.

John Lenz

unread,
Oct 20, 2014, 9:02:59 PM10/20/14
to Brian Slesinsky, Conrad Irwin, mozilla-dev-...@lists.mozilla.org, Sander Spies
A reverse index map would be fairly simple to do.

Sander Spies

unread,
Nov 5, 2014, 12:04:39 PM11/5/14
to John Lenz, Brian Slesinsky, mozilla-dev-...@lists.mozilla.org, Conrad Irwin
Any examples on how to do this properly would be greatly appreciated. From
reading the spec it seems impossible, but I would love to be proven wrong!

Just to be clear: I have a bundle.css and bundle.js which I both want to
refer to the same files, as the CSS is contained inside JavaScript.
0 new messages