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

gulp-autoprefixer

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-autoprefixer - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

51

index.js
'use strict';
var gutil = require('gulp-util');
var through = require('through2');
var autoprefixer = require('autoprefixer-core');
var applySourceMap = require('vinyl-sourcemaps-apply');
var objectAssign = require('object-assign');
var autoprefixer = require('autoprefixer-core');
var postcss = require('postcss');
var CssSyntaxError = require('postcss/lib/css-syntax-error');
module.exports = function (opts) {
opts = opts || {};
return through.obj(function (file, enc, cb) {

@@ -24,30 +21,28 @@ if (file.isNull()) {

try {
var fileOpts = objectAssign({}, opts);
var processor = postcss()
.use(autoprefixer(fileOpts))
.process(file.contents.toString(), {
map: file.sourceMap ? {annotation: false} : false,
from: file.path,
to: file.path
});
var fileOpts = objectAssign({}, opts);
var processor = postcss()
.use(autoprefixer(fileOpts))
.process(file.contents.toString(), {
map: file.sourceMap ? {annotation: false} : false,
from: file.path,
to: file.path
});
processor.then(function (res) {
file.contents = new Buffer(res.css);
processor.then(function (res) {
file.contents = new Buffer(res.css);
if (res.map && file.sourceMap) {
applySourceMap(file, res.map.toString());
}
if (res.map && file.sourceMap) {
applySourceMap(file, res.map.toString());
}
if (res.warnings && res.warnings()) {
res.warnings().forEach(function (warn) {
gutil.log(warn.toString());
});
}
var warnings = res.warnings();
cb(null, file);
});
} catch (err) {
var cssError = err instanceof CssSyntaxError;
if (warnings.length > 0) {
gutil.log('gulp-autoprefixer:', '\n ' + warnings.join('\n '));
}
cb(null, file);
}).catch(function (err) {
var cssError = err.name === 'CssSyntaxError';
if (cssError) {

@@ -61,4 +56,4 @@ err.message = err.message + err.showSourceCode();

}));
}
});
});
};
{
"name": "gulp-autoprefixer",
"version": "2.2.0",
"version": "2.3.0",
"description": "Prefix CSS",

@@ -30,3 +30,3 @@ "license": "MIT",

"preprocess",
"postcssrunner"
"postcss-runner"
],

@@ -33,0 +33,0 @@ "dependencies": {

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