承接 nickdekruijk/minify 相关项目开发

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

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

nickdekruijk/minify

最新稳定版本:3.0.0

Composer 安装命令:

composer require nickdekruijk/minify

包简介

A package for automaticaly minifying CSS, SCSS and Javascript for Laravel

README 文档

README

A simple package to minify CSS/SCSS and Javascript on the fly without the need of tools like Laravel Mix or Webpack. It combines all stylesheet files or javascript files into a single, minified file with simple but effective cachebusting with filemtime().

Version 2 is a completely new package (version 1 is archived here) using scssphp/scssphp and tedivm/jshrink. Because minify now replaces natxet/cssmin with scssphp it can now compile SASS/SCSS code too!

Installation

Begin by installing this package with composer.

composer require nickdekruijk/minify

Upgrading from 1.x

When upgrading change your projects composer.json to require nickdekruijk/minify with at least version "^2.0" and run composer update.

If you use .gitignore to ignore the old builds in js/builds and css/builds dont' forget to remove them from your .gitignore file and delete all obsolete build .css and .js files.

You may also need to change the Minify::stylesheet and Minify::javascript calls in your code/views since pathname might change depending on your configuration.

Laravel installation

Publish the config file if the defaults doesn't suite your needs:

php artisan vendor:publish --provider="NickDeKruijk\Minify\MinifyServiceProvider"

Stylesheet

// app/views/hello.blade.php
<html>
    <head>
        ...
        {!! Minify::stylesheet(['lightbox.css', 'fonts.css', 'styles.css']) !!}
    </head>
    ...
</html>

Javascript

// app/views/hello.blade.php

<html>
    <body>
        ...
        {!! Minify::javascript(['lazyload.min.js', 'scripts.js']) !!}
        <!-- Or: -->
        {!! Minify::javascript(['https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.4.0/dist/lazyload.min.js', 'scripts.js') !!}
    </body>
</html>

Config

See the config file at /config/minify.php

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-20