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.5 to 7.1.0

5

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

@@ -10,2 +11,5 @@ 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;

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

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

@@ -23,0 +28,0 @@ };

51

lib/process.js

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

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

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

return loadConfig(file, config).then((config) => {
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((root) => {
return postcss(
config.plugins
).process(
root,
config.options
);
})
).then((results) => {
const messages = results.reduce((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(),
messages: messages,
}
);
});
} else {
return document.toResult(
Object.assign(
{},
config.options,
{
syntax: syntax,
}
)
);
}
return postcss(config.plugins).process(buffer, config.options);
}).then(handleResult, handleError);

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

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

},
"version": "7.0.5",
"version": "7.1.0",
"description": "Process inline CSS in HTML using PostCSS gulp plugin",

@@ -47,8 +47,14 @@ "main": "lib/index.js",

"dependencies": {
"bufferstreams": "^1.1.3",
"bufferstreams": "^2.0.1",
"plugin-error": "^1.0.1",
"postcss-html": "^0.17.0",
"postcss-html": "^0.23.6",
"postcss-jsx": "^0.9.0",
"postcss-load-config": "^1.2.0",
"postcss-load-options": "^1.2.0",
"postcss-load-plugins": "^2.3.0",
"postcss-markdown": "^0.23.6",
"postcss-sass": "^0.3.1",
"postcss-scss": "^1.0.5",
"postcss-syntax": "^0.9.0",
"sugarss": "^1.0.1",
"vinyl-sourcemaps-apply": "^0.2.1"

@@ -60,20 +66,20 @@ },

"devDependencies": {
"coveralls": "^3.0.0",
"coveralls": "^3.0.1",
"eslint": "^4.19.1",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-standard": "^3.1.0",
"from2-array": "0.0.4",
"gulp-rename": "^1.2.2",
"gulp-sourcemaps": "^2.6.4",
"mocha": "^5.0.5",
"nyc": "^11.6.0",
"postcss": "^6.0.21",
"mocha": "^5.1.1",
"nyc": "^11.7.2",
"postcss": "^6.0.22",
"postcss-less": "^1.1.5",
"proxyquire": "^2.0.1",
"sinon": "^4.4.8",
"sinon": "^5.0.7",
"vinyl": "^2.1.0"
}
}

@@ -7,5 +7,8 @@ # gulp-html-postcss

[PostCSS](https://github.com/postcss/postcss) gulp plugin to pipe inline CSS in HTML within the `<style>` tags through
several plugins, but parse CSS only once.
[PostCSS](https://github.com/postcss/postcss) gulp plugin with support for HTML and HTML-like:
- [JSX](https://reactjs.org/docs/introducing-jsx.html)
- [Vue component](https://vue-loader.vuejs.org/)
- [Quick App](https://doc.quickapp.cn/framework/source-file.html)
- [Markdown](https://daringfireball.net/projects/markdown/syntax)
## Install

@@ -12,0 +15,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