broccoli-autoprefixer
Advanced tools
Comparing version 2.1.0 to 3.0.0
23
index.js
'use strict'; | ||
var Filter = require('broccoli-filter'); | ||
var objectAssign = require('object-assign'); | ||
var autoprefixer = require('autoprefixer-core'); | ||
var objectAssign = require('object-assign'); | ||
var postcss = require('postcss'); | ||
@@ -32,5 +33,23 @@ function AutoprefixerFilter(inputTree, options) { | ||
return autoprefixer(opts).process(str, opts).css; | ||
return postcss(autoprefixer(opts)) | ||
.process(str, opts) | ||
.then(function (res) { | ||
var warnings = res.warnings(); | ||
if (warnings.length > 0) { | ||
console.error(warnings.join('\n')); | ||
} | ||
return res.css; | ||
}) | ||
.catch(function (err) { | ||
if (err.name === 'CssSyntaxError') { | ||
// TODO: find a way to hide the stack so to adhere to the PostCSS guidelines | ||
err.message += err.showSourceCode(); | ||
} | ||
throw err; | ||
}); | ||
}; | ||
module.exports = AutoprefixerFilter; |
{ | ||
"name": "broccoli-autoprefixer", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "Prefix CSS using Autoprefixer", | ||
@@ -10,3 +10,3 @@ "license": "MIT", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
@@ -25,5 +25,9 @@ "engines": { | ||
"autoprefixer", | ||
"postcss", | ||
"css", | ||
"prefix", | ||
"preprocess" | ||
"prefixes", | ||
"stylesheet", | ||
"preprocess", | ||
"postcss-runner" | ||
], | ||
@@ -33,7 +37,8 @@ "dependencies": { | ||
"broccoli-filter": "^0.1.6", | ||
"object-assign": "^2.0.0" | ||
"object-assign": "^2.0.0", | ||
"postcss": "^4.1.11" | ||
}, | ||
"devDependencies": { | ||
"broccoli": "^0.13.3", | ||
"broccoli-cli": "0.0.1", | ||
"broccoli": "^0.16.3", | ||
"broccoli-cli": "^1.0.0", | ||
"mocha": "*", | ||
@@ -40,0 +45,0 @@ "rimraf": "^2.2.6" |
@@ -10,5 +10,5 @@ # [broccoli](https://github.com/joliss/broccoli)-autoprefixer [![Build Status](https://travis-ci.org/sindresorhus/broccoli-autoprefixer.svg?branch=master)](https://travis-ci.org/sindresorhus/broccoli-autoprefixer) | ||
```sh | ||
$ npm install --save broccoli-autoprefixer | ||
``` | ||
$ npm install --save-dev broccoli-autoprefixer | ||
``` | ||
@@ -26,3 +26,3 @@ | ||
### autoprefixer(tree, options) | ||
### autoprefixer(tree, [options]) | ||
@@ -29,0 +29,0 @@ #### options |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5022
43
4
+ Addedpostcss@^4.1.11