javascript - How to include compiled CSS/JS with hashed file name into the webpage -


if compile/merge css/js files 1 compiler (e.g. webpack, grunt), name of file hashed (e.g. df48gf8d789ds9fs.css).

is there kind of convention of including these files website?

i mean, per usual,

<link rel="stylesheet" href="style.css" /> 

however, if have hashed file name, can not hard-code above.

how shall 1 e.g. in php?

my idea so, not know, there has better solution.

<link rel="stylesheet" href="<?php echo get_dir_files_and_find_one_css(); ?>" /> 

edit: yes, have hashed file name, prevent browser caching file.

yeah, hash used updating old caches browser may have , way use file inject filename html when building project through script of sorts. however, specifying filename when using compiler doesn't cause problem.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -