@@ -159,8 +159,8 @@ function nullSafeEqual(prev, next) {
159
159
/**
160
160
* remove code that only changes metadata and does not require a js update for the component to keep working
161
161
*
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
164
164
*
165
165
* @param {string | null | undefined } code
166
166
* @returns {string | null | undefined }
@@ -172,9 +172,10 @@ function normalize(code) {
172
172
173
173
return (
174
174
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, '' )
179
180
) ;
180
181
}
0 commit comments