soundasleep/asset-discovery 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

soundasleep/asset-discovery

最新稳定版本:0.1.1

Composer 安装命令:

composer require soundasleep/asset-discovery

包简介

README 文档

README

asset-discovery is a Composer-enabled PHP script to locate assets (JS, CSS, Coffee, SASS, images) across multiple PHP components which then can be copied automatically into generated stylesheets, scripts and image folders.

Based on component-discovery.

Configuring

First include asset-discovery as a requirement in your project composer.json, and run composer update to install it into your project:

{
  "require": {
    "soundasleep/asset-discovery": "dev-master"
  }
}

Now create a asset-discovery.json in your project, to define the types of assets to discover, and where to place source files:

{
  "src": ["vendor/*/*", "core"],
  "js": "site/generated/js/generated.js",
  "coffee": "site/generated/js/generated-coffee.coffee",
  "css": "site/generated/css/generated.css",
  "scss": "site/generated/css/generated-scss.scss",
  "images": "site/generated/images/"
}

asset-discovery will look in all the src folders for files called assets.json to find matching assets. Wildcards are supported. For example, in your vendor/my/package/assets.json:

{
  "scss": ["css/currencies.scss", "css/second.scss"],
  "coffee": ["js/*.coffee"],
  "images": ["images/*"]
}

Generated asset files, other than images, will be included in the source order specified.

Building

Run the generate script, either with your build script or manually, with a given root directory:

php -f vendor/soundasleep/asset-discovery/generate.php .

This will generate various files under the directories defined in your asset-discovery.json config. These files can then be passed along to the next step in a build chain (e.g. compile SASS to CSS, minify, spritify, optimize images etc).

TODOs

  1. Actually publish on Packagist
  2. More documentation, especially default asset-discovery.json parameters
  3. Tests
  4. Example projects using asset-discovery
  5. Create grunt task grunt-php-asset-discovery to wrap the manual PHP command
  6. Release 0.1 version

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-12-28