Giter Club home page Giter Club logo

metalsmith-clean-css's Introduction

metalsmith-clean-css

travis github npm

This plugin allows you to minify your CSS files by leveraging clean-css.

Install

npm install metalsmith-clean-css clean-css

Usage

CLI

metalsmith.json

{
  "plugins": {
    "metalsmith-clean-css": {
      "files": "**/*.css"
    }
  }
}

Node.js

const metalsmith = require('metalsmith')
const metalsmithCleanCSS = require('metalsmith-clean-css')

metalsmith(__dirname).use(
  metalsmithCleanCSS({
    files: 'src/**/*.css',
    cleanCSS: {
      rebase: true,
    },
  })
)

API

metalsmithCleanCSS(options)

options

Type: Object Default: {}

options.cleanCSS

Type: Object Default: {}

Allow you to directly manipulate the clean-css API. The configuration object will be passed as is.

options.files

Type: string Default: **/*.css

This option defines which files are concerned by the minification. This string is directly passed to minimatch. Each file matching the pattern will be minified in place using clean-css.

options.sourceMap

Type: boolean Default: false

Whether the source maps should be kept after the minification. You can force to inline the source maps (without creating an extra .map file in the build) by setting options.sourceMapInlineSources to true.

This plugin supports the forwarding of existing source maps, it will first look for a sourceMap property on the file, then for .map file, and finally fallback to inline source maps.

options.sourceMapInlineSources

Type: boolean Default: false

Whether the source maps should be inlined in each CSS file. If set to true the source maps will be inlined in each file, and no extra .map file will be generated.

metalsmith-clean-css's People

Contributors

aymericbeaumet avatar dependabot[bot] avatar greenkeeper[bot] avatar michel-kraemer avatar vvo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

metalsmith-clean-css's Issues

Update peer dependency

Would you be willing to update the peer dependency to support the current, 5.x.x version of clean-css?

clean css as a peer dependency?

Hi! Since this metalsmith plugin wraps clean-css, maybe we could put clean-css as a peer dependency to allow users to upgrade it without you having to upgrade your own lib? I am looking at using your plugin but wanted to ask that.

I can do the PR :)

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

possible to clean the output of metalsmith-less

my metalsmith source css is less, and is compiled into css during the build process. Is it possible to compress the contents of the css that has been output by the previous less plugin? The example shows looking for files with .css extension, but my css is only in the metalsmith output buffer, not in the source dir

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.