Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nickkaramoff/taskr-postcss

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nickkaramoff/taskr-postcss

PostCSS plugin for Taskr

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

@nickkaramoff/taskr-postcss npm

PostCSS plugin for Taskr.

Heads up!

This is a fork of the official @taskr/postcss package with a few differences:

  • this package uses PostCSS 8 (and not 6)
  • thus, this package supports Node version 10 and higher (like PostCSS 8 itself)
  • it loads the config using PostCSS' own postcss-load-config

While this can be used as a drop-in replacement for @taskr/postcss, there is no guarantee that your build won't break. Use with caution!

Install

$ npm install --save-dev @nickkaramoff/taskr-postcss

API

.postcss([options])

Check out PostCSS's Options documentation to see the available options.

Note: There should be no need to set options.to and options.from.

If you would like to autoload external PostCSS config, you must not define any options directly.

Usage

Embedded Options

Declare your PostCSS options directly within your taskfile.js:

exports.styles = function * (task) {
  yield task.source('src/**/*.scss').postcss({
    plugins: [
      require('precss'),
      require('autoprefixer')({
        browsers: ['last 2 versions']
      })
    ],
    options: {
      parser: require('postcss-scss')
    }
  }).target('dist/css');
}
Autoloaded Options

Automatically detect & connect to existing PostCSS configurations

If no options were defined, @nickkaramoff/taskr-postcss will look for existing .postcssrc, postcss.config.js, and .postcssrc.js root-directory files. Similarly, it will honor a "postcss" key within your package.json file.

  • .postcssrc -- must be JSON; see example
  • .postcssrc.js -- can be JSON or module.exports a Function or Object; see example
  • postcss.config.js -- can be JSON or module.exports a Function or Object; see example
  • package.json -- must use "postcss" key & must be JSON; see example

Important: If you take this route, you only need one of the files mentioned!

// taskfile.js
exports.styles = function * (task) {
  yield task.source('src/**/*.scss').postcss().target('dist/css');
}
// .postcssrc
{
  "plugins": {
    "precss": {},
    "autoprefixer": {
      "browsers": ["last 2 versions"]
    }
  },
  "options": {
    "parser": "postcss-scss"
  }
}

Support

Any issues or questions about Taskr can be sent to the Taskr monorepo.

Any issues about this package should be sent here.

License

MIT © Luke Edwards MIT © Nikita Karamov

Keywords

FAQs

Package last updated on 22 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc