1.1.0 • Published 4 years ago

@goodthnx/metalsmith-postcss v1.1.0

Weekly downloads
7
License
MIT
Repository
-
Last release
4 years ago

Metalsmith PostCSS

PostCSS integration for Metalsmith.

Key features

  • loading postcss.config.js files
  • target rewriting (.sss -> .css)
  • unit tests

Usage

const postcss = require('metalsmith-postcss')

new Metalsmith(__dirname)
.use(postcss({
    pattern: '**/*.{sss,css}',
    config: './postcss.config.js',
    // 'config' AND/OR inline (these will override config file settings)
    plugins: {
        'postcss-preset-env': {stage: 1},
        ...
    },
    map: {inline: true},
}))
.build(err => {
    if (err) throw err;
})

Notes

I wrote this plugin because I wasn't getting what I wanted from existing solutions. In a mindless coding rage I ended up with this.

Perhaps later when I'm feeling more bold, a pull-request into metalsmith-postcss would be more appropriate.

1.1.0

4 years ago

1.0.0

5 years ago