Skip to content

Commit 6fc76d4

Browse files
committed
use query string instead of path for versioning client JS
1 parent 05dc70d commit 6fc76d4

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

lib/connect-utils.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,20 +214,18 @@ var connectUtils = {
214214
*/
215215
clientScript: function (options, both) {
216216

217-
var prefix = options.getIn(["socket", "clientPath"]);
218-
var script = prefix + "/browser-sync-client.js";
219-
var template = prefix + "/browser-sync-client.%s.js";
220-
221-
var compiled = template.replace("%s", options.get("version"));
217+
var prefix = options.getIn(["socket", "clientPath"]);
218+
var script = prefix + "/browser-sync-client.js";
219+
var versioned = prefix + "/browser-sync-client.js?v=" + options.get("version");
222220

223221
if (both) {
224222
return {
225223
path: script,
226-
versioned: compiled
224+
versioned: versioned
227225
};
228226
}
229227

230-
return compiled;
228+
return versioned;
231229
}
232230
};
233231

0 commit comments

Comments
 (0)