Add last modified time as version to css and js

You could use add_query_arg() but then you’d have to parse the uri everytime, I’d rather create a wrapper function for wp_enqueue_script/style:

function my_enqueuer($my_handle, $relpath, $type="script", $my_deps=array()) {
    $uri = get_theme_file_uri($relpath);
    $vsn = filemtime(get_theme_file_path($relpath));
    if($type == 'script') wp_enqueue_script($my_handle, $uri, $my_deps, $vsn);
    else if($type == 'style') wp_enqueue_style($my_handle, $uri, $my_deps, $vsn);      
}

Add this in your functions file and then in place of e.g.

wp_enqueue_script('_base', get_theme_file_uri('/assets/js/base.js'), array(), filemtime(get_theme_file_path('/assets/js/base.js')));

call:

my_enqueuer('_base', '/assets/js/base.js');

and in place of e.g.

wp_enqueue_style('_base', get_theme_file_uri('/assets/css/base.css'), array(), filemtime(get_theme_file_path('/assets/css/base.css')));

call:

my_enqueuer('_base', '/assets/css/base.css', 'style');

You can pass the dependency array as the last argument when needed. For scripts, if you pass the dependency array, you will have to pass the third parameter ‘script’ as well, even though I’ve set it as the default value.