LearnWebCode/university-static

Changes to JavaScripts files have no effect

Opened this issue · 0 comments

In Section 11, Lesson 50, we're asked to make a change to src/index.js (adding an alert). When visiting my site's homepage, I did not see the alert. I performed a "Hard Reload" and an "Empty Cache and Reload", but neither resolved my issue. I found that changing which JavaScript file was enqueued in functions.php from /src/index.js to /build/index.js caused the alert to appear.

So, in functions.php, I changed this:

function university_files()
{
    wp_enqueue_script('main-university-js', get_theme_file_uri('/src/index.js'), array('jquery'), '1.0', true);
	...
}

To this:

function university_files()
{
    wp_enqueue_script('main-university-js', get_theme_file_uri('/build/index.js'), array('jquery'), '1.0', true);
	...
}