broccoli-autoprefixer
Advanced tools
Comparing version 5.0.0 to 6.0.0
79
index.js
@@ -6,53 +6,48 @@ 'use strict'; | ||
function AutoprefixerFilter(inputTree, _options) { | ||
const options = _options || {}; | ||
module.exports = class extends Filter { | ||
constructor(inputTree, options = {}) { | ||
super(inputTree, options); | ||
this.inputTree = inputTree; | ||
this.options = options; | ||
} | ||
if (!(this instanceof AutoprefixerFilter)) { | ||
return new AutoprefixerFilter(inputTree, _options); | ||
get extension() { | ||
return ['css']; | ||
} | ||
Filter.call(this, inputTree, options); | ||
get targetExtension() { | ||
return 'css'; | ||
} | ||
this.inputTree = inputTree; | ||
this.options = options; | ||
} | ||
processString(text, relativePath) { | ||
const options = Object.assign({ | ||
from: relativePath, | ||
to: relativePath | ||
}, this.options); | ||
AutoprefixerFilter.prototype = Object.create(Filter.prototype); | ||
AutoprefixerFilter.prototype.constructor = AutoprefixerFilter; | ||
// Support explicit override of inline sourcemaps | ||
if (options.sourcemap !== null || options.sourcemap !== undefined) { | ||
options.map = options.sourcemap ? 'inline' : false; | ||
} | ||
AutoprefixerFilter.prototype.extensions = ['css']; | ||
AutoprefixerFilter.prototype.targetExtension = 'css'; | ||
return postcss(autoprefixer(options)) | ||
.process(text, options) | ||
.then(result => { | ||
const warnings = result.warnings(); | ||
AutoprefixerFilter.prototype.processString = function (str, relativePath) { | ||
const opts = Object.assign({ | ||
from: relativePath, | ||
to: relativePath | ||
}, this.options); | ||
if (warnings.length > 0) { | ||
console.error(warnings.join('\n')); | ||
} | ||
// Support explicit override of inline sourcemaps | ||
if (opts.sourcemap !== null || opts.sourcemap !== undefined) { | ||
opts.map = opts.sourcemap ? 'inline' : false; | ||
return result.css; | ||
}) | ||
.catch(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; | ||
}); | ||
} | ||
return postcss(autoprefixer(opts)) | ||
.process(str, opts) | ||
.then(result => { | ||
const warnings = result.warnings(); | ||
if (warnings.length > 0) { | ||
console.error(warnings.join('\n')); | ||
} | ||
return result.css; | ||
}) | ||
.catch(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": "5.0.0", | ||
"description": "Prefix CSS using Autoprefixer", | ||
"license": "MIT", | ||
"repository": "sindresorhus/broccoli-autoprefixer", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && broccoli build temp && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"broccoli-plugin", | ||
"autoprefixer", | ||
"postcss", | ||
"css", | ||
"prefix", | ||
"prefixes", | ||
"stylesheet", | ||
"preprocess", | ||
"postcss-runner" | ||
], | ||
"dependencies": { | ||
"autoprefixer": "^7.0.0", | ||
"broccoli-persistent-filter": "^1.1.6", | ||
"postcss": "^6.0.1" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"broccoli": "^1.1.1", | ||
"broccoli-cli": "^1.0.0", | ||
"del": "^2.2.2", | ||
"xo": "*" | ||
} | ||
"name": "broccoli-autoprefixer", | ||
"version": "6.0.0", | ||
"description": "Prefix CSS using Autoprefixer", | ||
"license": "MIT", | ||
"repository": "sindresorhus/broccoli-autoprefixer", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "xo && broccoli build temp && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"broccoli-plugin", | ||
"autoprefixer", | ||
"postcss", | ||
"css", | ||
"prefix", | ||
"prefixes", | ||
"stylesheet", | ||
"preprocess", | ||
"postcss-runner" | ||
], | ||
"dependencies": { | ||
"autoprefixer": "^8.0.0", | ||
"broccoli-persistent-filter": "^1.1.6", | ||
"postcss": "^6.0.1" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"broccoli": "^1.1.1", | ||
"broccoli-cli": "^1.0.0", | ||
"del": "^3.0.0", | ||
"xo": "*" | ||
} | ||
} |
@@ -18,4 +18,4 @@ # [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) | ||
```js | ||
const autoprefixer = require('broccoli-autoprefixer'); | ||
tree = autoprefixer(tree, options); | ||
const Autoprefixer = require('broccoli-autoprefixer'); | ||
tree = new Autoprefixer(tree, options); | ||
``` | ||
@@ -26,3 +26,3 @@ | ||
### autoprefixer(tree, [options]) | ||
### Autoprefixer(tree, [options]) | ||
@@ -29,0 +29,0 @@ #### options |
Sorry, the diff of this file is not supported yet
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
4493
43
+ Addedautoprefixer@8.6.5(transitive)
+ Addedbrowserslist@3.2.8(transitive)
- Removedautoprefixer@7.2.6(transitive)
- Removedbrowserslist@2.11.3(transitive)
Updatedautoprefixer@^8.0.0