addyosmani/critical

Remove query string from stylesheet path

Open

#551 创建于 2023年1月31日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)JavaScript (9,902 star) (457 fork)batch import
bughelp wanted

描述

In my simple PHP file I reference my stylesheet as follows:

<link rel="stylesheet" href="css/style.css?v=<?php echo filemtime( 'css/style.css' ); ?>"

When using the CLI, I get the following error:

Error: File not found: css/style.css?v=<?php echo filemtime( 'css/style.css' ); ?>

This could be addressed by automatically removing query strings like ?v before trying to access the file. After that it works as expected.

贡献者指南