Why isn't my custom admin JS file executing?

Please note, this is the Sage10 dev version. I have a simple file: resources/assets/scripts/admin.js

console.log('loaded');

$(document).ready(() => {
   console.log('Hello world');
});

In setup.php

add_action('admin_enqueue_scripts', function() {
    wp_enqueue_script('alk-admin-js', asset('scripts/admin.js')->uri(), ['jquery']);
    wp_enqueue_style('alk-admin', asset('styles/admin.css')->uri(), false, null);
}, 100);

Update webpack.mix.js:

mix.js('resources/assets/scripts/app.js', 'scripts')
   .js('resources/assets/scripts/customizer.js', 'scripts')
   .js('resources/assets/scripts/admin.js', 'scripts')
   .blocks('resources/assets/scripts/editor.js', 'scripts')
   .extract();

Run yarn build

I load the admin screen, I check the page source and I see it being loaded, but nothing is being executed or written to the console. What step am I missing?

This topic was automatically closed after 42 days. New replies are no longer allowed.