问题
In Firebug, //@ sourceURL can be used in a Javascript eval
. We can use this technique to concatenate multiple Javascript files into a single file, and still have them show up as separate files in devtools/Firebug, like so:
eval("... foo.js contents ...\n//@ sourceURL=foo.js");
eval("... bar.js contents ...\n//@ sourceURL=bar.js");
Is there a similar technique for CSS files?
回答1:
In CSS the correct API is to use:
/*# sourceURL=<url> */
回答2:
In the absence of a better idea, it might also be possible to use Sass sourcemaps to achieve something like this. It seems like a hack, but perhaps it's a start.
Thanks to Andy Matthews for the pointer.
来源:https://stackoverflow.com/questions/15262506/sourceurl-equivalent-for-css