Hi Robert,
Yes, there’s a way. You can create the file and enqueue it. See here for an example: https://developer.wordpress.org/reference/functions/wp_enqueue_script/#comment-274
To enqueue a file to a specific page, you just need a conditional statement.
An example where 123 is the ID of the page:
function wpdocs_theme_name_scripts() {
is_page( 123 ){
wp_enqueue_style( 'style-name', get_stylesheet_uri() );
wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
}
}
add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts' );