New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rollup-plugin-postcss

Package Overview
Dependencies
Maintainers
2
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-postcss - npm Package Compare versions

Comparing version 0.4.3 to 0.5.0

29

dist/index.common.js

@@ -25,5 +25,3 @@ 'use strict';

var fileName = path.basename(autoDest, path.extname(autoDest));
var cssOutputDest = manualDest ?
manualDest :
path.join(path.dirname(autoDest), fileName + '.css');
var cssOutputDest = manualDest ? manualDest : path.join(path.dirname(autoDest), fileName + '.css');
var css = source.content.toString('utf8');

@@ -39,5 +37,3 @@ var promises = [];

if (sourceMap === 'inline') {
css += '\n/*# sourceMappingURL=data:application/json;base64,' +
Buffer.from(map, 'utf8').toString('base64') +
' */';
css += "\n/*# sourceMappingURL=data:application/json;base64," + (Buffer.from(map, 'utf8').toString('base64')) + "*/";
} else {

@@ -59,3 +55,3 @@ css += "\n/*# sourceMappingURL=" + fileName + ".css.map */";

var extensions = options.extensions || ['.css', '.sss'];
var getExport = options.getExport || function () {};
var getExport = typeof options.getExport === 'function' ? options.getExport : false;
var combineStyleTags = Boolean(options.combineStyleTags);

@@ -125,2 +121,12 @@ var extract = Boolean(options.extract);

.then(function (result) {
var codeExportDefault;
var codeExportSparse = '';
if (getExport) {
codeExportDefault = getExport(result.opts.from);
Object.keys(codeExportDefault).forEach(function (k) {
codeExportSparse += "export const " + k + "=" + (JSON.stringify(codeExportDefault[k])) + ";\n";
});
}
if (combineStyleTags || extract) {

@@ -131,4 +137,5 @@ transformedFiles[result.opts.from] = {

};
return {
code: ("export default " + (JSON.stringify(getExport(result.opts.from))) + ";"),
code: (codeExportSparse + "export default " + (JSON.stringify(codeExportDefault)) + ";"),
map: {mappings: ''}

@@ -139,6 +146,4 @@ };

return {
code: ("export default " + injectFnName + "(" + (JSON.stringify(result.css)) + "," + (JSON.stringify(getExport(result.opts.from))) + ");"),
map: options.sourceMap && result.map ?
JSON.parse(result.map) :
{mappings: ''}
code: (codeExportSparse + "export default " + injectFnName + "(" + (JSON.stringify(result.css)) + "," + (JSON.stringify(codeExportDefault)) + ");"),
map: options.sourceMap && result.map ? JSON.parse(result.map) : {mappings: ''}
};

@@ -145,0 +150,0 @@ });

{
"name": "rollup-plugin-postcss",
"version": "0.4.3",
"version": "0.5.0",
"description": "Seamless integration between Rollup and PostCSS",

@@ -38,4 +38,4 @@ "main": "dist/index.common.js",

"jsdom": "^9.2.1",
"postcss-modules": "^0.6.4",
"postcss-nested": "^1.0.0",
"postcss-modules": "^0.7.0",
"postcss-nested": "^2.0.2",
"require-from-string": "^1.1.0",

@@ -46,3 +46,3 @@ "rimraf": "^2.6.1",

"stylus": "^0.54.5",
"sugarss": "^0.2.0",
"sugarss": "^1.0.0",
"xo": "^0.18.1"

@@ -53,3 +53,3 @@ },

"fs-extra": "^3.0.1",
"postcss": "^5.0.12",
"postcss": "^6.0.1",
"rollup-pluginutils": "^2.0.1",

@@ -56,0 +56,0 @@ "style-inject": "^0.1.0"

@@ -91,3 +91,10 @@ # rollup-plugin-postcss

```
You also can import only a specific CSS className like this:
```js
import {className} from './style.css';
console.log(className); // .className_echwj_2
```
### Extract CSS

@@ -94,0 +101,0 @@

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