npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-less-minify

v1.0.12

Published

gulp less压缩插件、只压缩不编译、less变量动态替换、gulp less compress、 gulp less minify

Downloads

3

Readme

重要

此工具是基于less-minify封装的gulp插件,只做LESS压缩优化及变量替换,不编译。只压缩不编译!!!(just compress, not compile!!!),如果你需要对less文件进行编译并压缩,请使用如gule-less之类工具。

gulp-less-minify

基于less-minify封装的gulp插件,用于css预处理器less源码文件压缩及环境变量动态替换。

功能介绍

  1. less源码文件压缩,主要去除多个空格、换行、单行注释、多行注释以及部分语法兼容处理
  2. css源码文件压缩,主要去除多个空格、换行、注释等,对于CSS压缩
  3. less及css文件中标记的环境变量动态替换

使用说明

  1. install 安装
    npm install --save-dev gulp-less-minify
  1. 引入及使用
const LessMinify = require('gulp-less-minify');
const param = {
    test: {
        LESS_MINIFY_STYLE_PARAM_FONT_COLOR: '#0F0',
        LESS_MINIFY_STYLE_PARAM_BACKGROUND_IMAGE_URL: 'https://test.com/test.png',
    },
    prod: {
        LESS_MINIFY_STYLE_PARAM_FONT_COLOR: '#00F',
        LESS_MINIFY_STYLE_PARAM_BACKGROUND_IMAGE_URL: 'https://prod.com/prod.png',
    }
}
const env = 'test';

// 使用
const input = './style.less'; // 可以是相对路径或者绝对路径
gulp.src(lessFiles)
    .pipe(LessMinify(param[env]))
    .pipe(gulp.dest(distPath));