承接 elminson/css-js-versioning 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elminson/css-js-versioning

最新稳定版本:v1.2.0

Composer 安装命令:

composer require elminson/css-js-versioning

包简介

This package generate a css and js versioning based on the commit hash

README 文档

README

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/

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-20