Skip to content

Commit eecd638

Browse files
authored
[5.x] Make Live Preview force reload JS modules optional (#11715)
1 parent 33c0763 commit eecd638

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

config/live_preview.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,16 @@
3333
//
3434
],
3535

36+
/*
37+
|--------------------------------------------------------------------------
38+
| Force Reload Javascript Modules
39+
|--------------------------------------------------------------------------
40+
|
41+
| To force a reload, Live Preview appends a timestamp to the URL on
42+
| script tags of type 'module'. You may disable this behavior here.
43+
|
44+
*/
45+
46+
'force_reload_js_modules' => true,
47+
3648
];

src/Http/Responses/DataResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ protected function contents()
149149
{
150150
$contents = $this->view()->render();
151151

152-
if ($this->request->isLivePreview()) {
152+
if ($this->request->isLivePreview() && config('statamic.live_preview.force_reload_js_modules', true)) {
153153
$contents = $this->versionJavascriptModules($contents);
154154
}
155155

0 commit comments

Comments
 (0)