Closed mercs600 closed 5 years ago
@mercs600 you can try adding a query at the end like so:
wp_enqueue_script('blankslate/app.js', get_template_directory_uri() . '/dist/scripts/app.js?v='.time(), null, null, true);
@manacim this way your assets won't be cached, because each request will generate new timestamp. Not good for production ;-(
Thanks for the heads up @mercs600 I actually normally do something like this for scripts, just haven't added it to this repo yet.
wp_enqueue_script(
'app-js,
get_stylesheet_directory_uri() . '/dist/index.min.bundle.js',
null,
filemtime(get_stylesheet_directory() . '/dist/index.min.bundle.js'),
true
);
@EvanAgee Thanks! Probably this method solves the problem ;-)
Hi @EvanAgee, great job ;-) I did not use it starter yet, but I see potential problem with cache busting.
https://github.com/EvanAgee/vuejs-wordpress-theme-starter/blob/master/functions.php
I see you attach file without any specific version. What in case when you rebuild some js/css files ? How did you resolve it ?