Socket
Socket
Sign inDemoInstall

gulp-html-postcss

Package Overview
Dependencies
133
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.0.1 to 7.0.2

.circleci/config.yml

6

lib/loadConfig.js
'use strict';
const syntax = require('postcss-html');
const postcssLoadConfig = require('postcss-load-config');

@@ -11,5 +10,2 @@ const loadOptions = require('postcss-load-options/lib/options.js');

const options = config.options || {};
if (!(options.syntax || options.stringifier || options.parser)) {
options.syntax = syntax;
}
options.map = map;

@@ -25,3 +21,2 @@ config.options = options;

cwd: file.cwd,
syntax: syntax,
map: map,

@@ -54,2 +49,3 @@ };

});
return Promise.resolve(config);

@@ -56,0 +52,0 @@ }

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

const loadConfig = require('./loadConfig');
const autoSyntax = require('postcss-html');

@@ -29,3 +30,51 @@ function process(buffer, file, config) {

return loadConfig(file, config).then(function (config) {
return postcss(config.plugins).process(buffer, config.options);
const syntax = autoSyntax(config.options.syntax);
const document = syntax.parse(buffer, Object.assign({}, config.options));
if (document.source.syntax) {
return postcss(
config.plugins
).process(
document,
Object.assign(
{
syntax: document.source.syntax,
},
config.options
)
);
} else if (document.nodes.length) {
return Promise.all(
document.nodes.map(function(root) {
return postcss(
config.plugins
).process(
root,
config.options
);
})
).then(function(results) {
const messages = results.reduce(function(messages, result) {
return messages.concat(result.messages);
}, []);
const lastResult = results.pop();
return Object.assign(
new lastResult.constructor(lastResult.processor, document, lastResult.opts),
{
lastPlugin: lastResult.lastPlugin,
css: document.toString(syntax),
messages: messages,
}
);
});
} else {
return document.toResult(
Object.assign(
{},
config.options,
{
syntax: syntax,
}
)
);
}
}).then(handleResult, handleError);

@@ -32,0 +81,0 @@ }

@@ -16,3 +16,3 @@ {

},
"version": "7.0.1",
"version": "7.0.2",
"description": "Process inline CSS in HTML using PostCSS gulp plugin",

@@ -49,3 +49,3 @@ "main": "lib/index.js",

"gulp-util": "^3.0.8",
"postcss-html": "^0.8.0",
"postcss-html": "^0.11.0",
"postcss-load-config": "^1.2.0",

@@ -60,14 +60,14 @@ "postcss-load-options": "^1.2.0",

"devDependencies": {
"coveralls": "^2.13.1",
"eslint": "^4.2.0",
"coveralls": "^3.0.0",
"eslint": "^4.11.0",
"from2-array": "0.0.4",
"gulp-rename": "^1.2.2",
"gulp-sourcemaps": "^2.6.0",
"mocha": "^3.4.2",
"nyc": "^11.0.3",
"postcss": "^6.0.6",
"postcss-less": "^1.1.0",
"gulp-sourcemaps": "^2.6.1",
"mocha": "^4.0.1",
"nyc": "^11.3.0",
"postcss": "^6.0.14",
"postcss-less": "^1.1.3",
"proxyquire": "^1.8.0",
"sinon": "^2.3.7"
"sinon": "^4.1.2"
}
}

@@ -23,3 +23,3 @@ # gulp-html-postcss

```js
const postcss = require('gulp-postcss');
const postcss = require('gulp-html-postcss');
const gulp = require('gulp');

@@ -26,0 +26,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc