Skip to content

Commit 167428a

Browse files
committed
Add sourceURL to inline assets
This is a super power! It turns out that if you add this to inline `script` and `style`, DevTools will associate them with a ghost file and not just `index`. It’ll also pretty print and give much better line numbers than if embedded in HTML. Stunning.
1 parent 3445cad commit 167428a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

_includes/head.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,21 @@
3535
{% if layout.lux %}
3636
LUX.label = '{{ layout.lux }}';
3737
{% endif %}
38+
//# sourceURL=speedcurve.js
3839
</script>
3940

4041
<script>
4142
(function(t,e,n,r){function a(){return e&&e.now?e.now():null}if(!n.version){n._events=[];n._errors=[];n._metadata={};n._urlGroup=null;window.RM=n;n.install=function(e){n._options=e;var a=t.createElement("script");a.async=true;a.crossOrigin="anonymous";a.src=r;var o=t.getElementsByTagName("script")[0];o.parentNode.insertBefore(a,o)};n.identify=function(t,e){n._userId=t;n._identifyOptions=e};n.sendEvent=function(t,e){n._events.push({eventName:t,metadata:e,time:a()})};n.setUrlGroup=function(t){n._urlGroup=t};n.track=function(t,e){n._errors.push({error:t,metadata:e,time:a()})};n.addMetadata=function(t){n._metadata=Object.assign(n._metadata,t)}}})(document,window.performance,window.RM||{},"https://cdn.requestmetrics.com/agent/current/rm.js");
4243
RM.install({
4344
token: "j5ss3vj:q7xf9tv"
4445
});
46+
//# sourceURL=request-metrics.js
4547
</script>
4648

47-
<script>(function(){var dbpr=100;if(Math.random()*100>100-dbpr){var d="dbbRum",w=window,o=document,a=addEventListener,scr=o.createElement("script");scr.async=!0;w[d]=w[d]||[];w[d].push(["presampling",dbpr]);["error","unhandledrejection"].forEach(function(t){a(t,function(e){w[d].push([t,e])});});scr.src="https://cdn.debugbear.com/vUKP1Yu0eg5g.js";o.head.appendChild(scr);}})()</script>
49+
<script>
50+
(function(){var dbpr=100;if(Math.random()*100>100-dbpr){var d="dbbRum",w=window,o=document,a=addEventListener,scr=o.createElement("script");scr.async=!0;w[d]=w[d]||[];w[d].push(["presampling",dbpr]);["error","unhandledrejection"].forEach(function(t){a(t,function(e){w[d].push([t,e])});});scr.src="https://cdn.debugbear.com/vUKP1Yu0eg5g.js";o.head.appendChild(scr);}})()
51+
//# sourceURL=debugbear.js
52+
</script>
4853

4954
<script>performance.mark('cssStart');</script>
5055
<style>
@@ -55,6 +60,8 @@
5560
{% include css/components.syntax.css %}
5661
{% endif %}
5762

63+
/*# sourceURL=csswizardry.css */
64+
5865
</style>
5966
<script>
6067
performance.mark('cssEnd');

0 commit comments

Comments
 (0)