I am trying to automate the process of renaming a CSS file and updating the reference in my PHP file. Currently, I have a file named base.css
and a PHP file called styles.php
containing the following code:
wp_enqueue_script('base', get_template_directory_uri() . '/css/base.css');
My goal is to use Gulp to hash rename the base.css
file to something like base-375dfd5f.css
and then automatically update the reference in styles.php
to:
wp_enqueue_script('base', get_template_directory_uri() . '/css/base-375dfd5f.css');