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

rollup-plugin-css-only

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-css-only - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

29

dist/index.cjs.js

@@ -38,3 +38,3 @@ 'use strict';

},
ongenerate: function ongenerate (opts, rendered) {
ongenerate: function ongenerate (opts) {
// No stylesheet needed

@@ -73,8 +73,11 @@ if (!changes || options.output === false) {

// Emit styles to file
fs.writeFile(dest, css, function (err) {
if (err) {
throw err
}
console.log(green(dest), getSize(css.length));
});
return new Promise(function (resolve, reject) {
fs.writeFile(dest, css, function (err) {
if (err) {
reject(err);
} else {
resolve();
}
});
})
}

@@ -84,14 +87,2 @@ }

function green (text) {
return '\u001b[1m\u001b[32m' + text + '\u001b[39m\u001b[22m'
}
function getSize (bytes) {
return bytes < 10000
? bytes.toFixed(0) + ' B'
: bytes < 1024000
? (bytes / 1024).toPrecision(3) + ' kB'
: (bytes / 1024 / 1024).toPrecision(4) + ' MB'
}
module.exports = css;

@@ -36,3 +36,3 @@ import { writeFile } from 'fs';

},
ongenerate: function ongenerate (opts, rendered) {
ongenerate: function ongenerate (opts) {
// No stylesheet needed

@@ -71,8 +71,11 @@ if (!changes || options.output === false) {

// Emit styles to file
writeFile(dest, css, function (err) {
if (err) {
throw err
}
console.log(green(dest), getSize(css.length));
});
return new Promise(function (resolve, reject) {
writeFile(dest, css, function (err) {
if (err) {
reject(err);
} else {
resolve();
}
});
})
}

@@ -82,14 +85,2 @@ }

function green (text) {
return '\u001b[1m\u001b[32m' + text + '\u001b[39m\u001b[22m'
}
function getSize (bytes) {
return bytes < 10000
? bytes.toFixed(0) + ' B'
: bytes < 1024000
? (bytes / 1024).toPrecision(3) + ' kB'
: (bytes / 1024 / 1024).toPrecision(4) + ' MB'
}
export default css;
{
"name": "rollup-plugin-css-only",
"version": "0.1.0",
"version": "0.2.0",
"description": "Rollup plugin that bundles imported css",

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

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