fix(scripts): bust tbquire module cache with newest runtime/*.js mtime
_win.ver only tracked main.min.js, so rebuilding svg-icon.js alone kept serving the cached sprite and new icons (ticket-color) rendered blank. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
54ea83b262
commit
b7a910b758
1 file changed
+6
-2
@@ -147,8 +147,12 @@ trait ScriptsPart1c {
|
||||
*/
|
||||
private function enqueue_public_fonts_js_and_data($base_uri, $core_dep, $deps, $is_fixed_homepage, $is_home_or_archive, $is_single_post, $is_single_resource, $version, array $singular_assets): void {
|
||||
$runtime_uri = $base_uri . '/assets';
|
||||
$runtime_main_path = get_template_directory() . '/assets/js/runtime/main.min.js';
|
||||
$runtime_version = file_exists($runtime_main_path) ? (string) filemtime($runtime_main_path) : $version;
|
||||
// tbquire 的 urlArgs 统一用此版本号;取所有按需加载模块中最新的 mtime,任何模块重建都会刷新缓存。
|
||||
$runtime_mtimes = array_map(
|
||||
'filemtime',
|
||||
glob(get_template_directory() . '/assets/js/runtime/*.js') ?: []
|
||||
);
|
||||
$runtime_version = $runtime_mtimes !== [] ? (string) max($runtime_mtimes) : $version;
|
||||
$loader_path = get_template_directory() . '/assets/js/runtime/loader.js';
|
||||
$bootstrap_path = get_template_directory() . '/assets/js/runtime/libs/bootstrap.min.js';
|
||||
$post_page_settings = class_exists('\AKSRT\Settings\Settings')
|
||||
|
||||
Reference in new issue
Block a user