Skip to content

elminson/css-js-versioning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

css-version

This package performs versioning of the css files.

Installation

composer require elminson/css-js-versioning

After install execute

composer run post-install-cmd

This command will install the pre-commit file on .git folder

How to use it

in your core html template load the version

<?php
$cssVersion = file_get_contents("css_version");
$jsVersion = file_get_contents("js_version");
?>


#implementation in all your css link href
<link href="<?=base_url();?>css/app.css?v=<?=$cssVersion?>" rel="stylesheet">
<link href="<?=base_url();?>css/morestyles.css?v=<?=$cssVersion?>" rel="stylesheet">

#implementation in all your js file
<script src="js/index.js?v=<?=$jsVersion?>"></script>

...

### No css or js changes

running local test

$ php -S localhost:8000 -t tests/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published