@@ -159,8 +159,8 @@ function nullSafeEqual(prev, next) {
159159/**
160160 * remove code that only changes metadata and does not require a js update for the component to keep working
161161 *
162- * 1) add_location() calls. These add location metadata to elements, only used by some dev tools
163- * 2) vite query timestamps t=1235345.
162+ * 1) location numbers argument from $.add_locations calls in svelte output eg [[1,2],[3,4]]
163+ * 2) timestamp queries added to imports by vite eg ?t=0123456789123
164164 *
165165 * @param {string | null | undefined } code
166166 * @returns {string | null | undefined }
@@ -172,9 +172,10 @@ function normalize(code) {
172172
173173 return (
174174 code
175- // svelte5 add_location line numbers argument
176- . replace ( / ( \$ \. a d d _ l o c a t i o n s \( .* ) , \[ ( \[ [ . [ \] , \d ] + ] ) ] / g, '$1, []' )
177- // vite import analysis timestamp queries
178- . replace ( / [ ? & ] t = \d + / g, '' )
175+ // svelte5 $.add_locations line numbers argument [[1,2],[3,4]]
176+ // uses matching group replace to keep the template argument intact
177+ . replace ( / ( \$ \. a d d _ l o c a t i o n s \( .* ) , ( \[ \[ [ \d , [ \] ] + ] ] ) \) / g, '$1, []' )
178+ // vite import analysis timestamp queries, ?t=0123456789123&
179+ . replace ( / [ ? & ] t = \d { 13 } \b / g, '' )
179180 ) ;
180181}
0 commit comments