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

browserify-css

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-css - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

test/fixtures/app.css

21

css-transform.js

@@ -108,2 +108,10 @@ 'use strict';

var processRule = function (rule) {
if (rebaseUrls) {
_.each(rule.declarations, function(declaration) {
declaration.value = rebase(declaration.value);
});
}
};
var data = fs.readFileSync(filename, 'utf8');

@@ -165,6 +173,8 @@ if ( ! data) {

} else {
if (rebaseUrls) {
_.each(rule.declarations, function(declaration) {
declaration.value = rebase(declaration.value);
});
if (rule.type === 'media') {
// handle rules in media query
_.each(rule.rules, processRule);
} else {
// handle normal rules
processRule(rule);
}

@@ -188,2 +198,5 @@

var defaults = {
rebaseUrls: true,
rootDir: process.cwd(),
processRelativeUrl: null
};

@@ -190,0 +203,0 @@

2

gulp/config.js

@@ -71,3 +71,3 @@ var _ = require('lodash');

return url;
return relativeUrl;
}

@@ -74,0 +74,0 @@ }

@@ -19,3 +19,2 @@ 'use strict';

},
rebaseUrls: true,
rootDir: process.cwd(),

@@ -46,3 +45,3 @@ onFlush: function(options, done) {

options = _.extend({}, options, opts);
options = _.merge({}, options, opts);

@@ -49,0 +48,0 @@ return through(

{
"name": "browserify-css",
"version": "0.9.0",
"version": "0.9.1",
"description": "A Browserify transform for bundling, rebasing, inlining, and minifying CSS files",

@@ -5,0 +5,0 @@ "main": "./index.js",

'use strict';
var fs = require('fs');
var path = require('path');
var test = require('tap').test;

@@ -52,1 +53,18 @@ var browserify = require('browserify');

});
test('processRelativeUrl with media query', function(t) {
var cssTransform = require('../css-transform');
var inputFile = path.resolve(__dirname, 'fixtures/app.css');
var outputFile = path.resolve(__dirname, 'fixtures/app.output.css');
cssTransform({
rootDir: path.resolve(__dirname, 'fixtures'),
rebaseUrls: true,
processRelativeUrl: function(relativeUrl) {
return 'images/' + relativeUrl;
}
}, inputFile, function(data) {
t.same(data, fs.readFileSync(outputFile, 'utf-8'));
t.end();
});
});
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