Socket
Socket
Sign inDemoInstall

postcss-critical-css

Package Overview
Dependencies
193
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.5 to 3.0.6-0

CHANGELOG.md

2

index.js

@@ -1,1 +0,1 @@

module.exports = require('./lib');
module.exports = require("./dist");
{
"name": "postcss-critical-css",
"version": "3.0.5",
"version": "3.0.6-0",
"description": "Generate critical CSS using PostCSS",

@@ -22,2 +22,4 @@ "main": "index.js",

"devDependencies": {
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"babel-cli": "^6.26.0",

@@ -29,20 +31,28 @@ "babel-eslint": "^7.2.3",

"eslint": "^3.3.1",
"eslint-config-prettier": "^6.9.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-flowtype": "^2.50.3",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-node": "^4.2.3",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-promise": "^3.8.0",
"eslint-plugin-standard": "^3.1.0",
"flow-bin": "^0.100.0",
"husky": "^3.1.0",
"lint-staged": "^9.5.0",
"minimist": "^1.2.0",
"tape": "^4.11.0"
"prettier": "1.19.1",
"standard-version": "^7.0.1",
"tape": "^4.12.1"
},
"scripts": {
"build": "eslint src/** && npm run flow && babel src --out-dir lib",
"build": "eslint src/** && npm run flow && babel src --out-dir dist",
"example": "./node_modules/.bin/babel-node example/example.js",
"flow": "flow; test $? -eq 0 -o $? -eq 2",
"eslint": "eslint test/**/*.js && eslint src/**",
"start": "eslint src/** && npm run flow && babel src --out-dir lib --watch",
"format": "prettier --write \"**/*.{js,md,yml,.babelrc,.eslintrc}\"",
"prerelease": "npm run build && npm test",
"pretest": "./node_modules/.bin/babel-node test/preTest.js",
"test": "npm run build && npm run test-default && npm run test-no-preserve && npm run test-output-path && npm run test-output-dest && npm run test-no-args && npm run test-no-minify",
"release": "standard-version",
"test": "npm run test-default && npm run test-no-preserve && npm run test-output-path && npm run test-output-dest && npm run test-no-args && npm run test-no-minify",
"test-no-args": "npm run pretest -- --noArgs && tape test --noArgs --test=default",

@@ -59,4 +69,16 @@ "test-no-minify": "npm run pretest -- --minify=false --fixtures-dir=fixtures-no-minify && tape test --fixtures-dir=fixtures-no-minify --test=default,this",

"fs-extra": "^8.1.0",
"postcss": "^7.0.18"
"postcss": "^7.0.25"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"eslint -- --fix",
"git add"
]
}
}
# PostCSS Critical CSS
![Travis build status](https://travis-ci.org/zgreen/postcss-critical-css.svg?branch=master)
This plugin allows the user to define and output critical CSS using custom atRules, and/or custom CSS properties. Critical CSS may be output to one or more files, as defined within the [plugin options](#plugin-options) and/or within the CSS. Depending on the plugin options used, processed CSS may be left unchanged, or critical CSS may be removed from it.

@@ -17,3 +15,3 @@

All examples given below show the input CSS and the critical CSS that is output from it. Note that the input CSS will remain unchanged, unless `preserve` is set to `false` in the [plugin options](#plugin-options). Use `npm run example` to see how this works.
All examples given below show the input CSS and the critical CSS that is output from it. Note that the input CSS will remain unchanged, unless `preserve` is set to `false` in the [plugin options](#plugin-options). Use `npm run example` to see how this works.

@@ -32,3 +30,5 @@ ### Using the `@critical` atRule

```
Will output:
```css

@@ -55,3 +55,5 @@ /* In critical.css */

```
Will output:
```css

@@ -83,3 +85,5 @@ /* In bar.css */

```
Will output:
```css

@@ -104,3 +108,5 @@ /* In critical.css */

```
Will output:
```css

@@ -126,3 +132,5 @@ /* In critical.css */

```
Will output:
```css

@@ -149,3 +157,5 @@ /* In critical.css */

```
Will output:
```css

@@ -178,3 +188,5 @@ /* In secondary-critical.css */

```
Will output:
```css

@@ -198,7 +210,7 @@ /* In critical.css */

| Arg | Type | Description | Default |
| ------------ | --------- | ------------------------------------------- | ------------------------- |
| `outputPath` | `string` | Path to which critical CSS should be output | Current working directory |
| `outputDest` | `string` | Default critical CSS file name | `"critical.css"` |
| `preserve` | `boolean` | Whether or not to remove selectors from primary CSS document once they've been marked as critical. This should prevent duplication of selectors across critical and non-critical CSS. | `true` |
| `minify` | `boolean` | Minify output CSS? | `true` |
| Arg | Type | Description | Default |
| ------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| `outputPath` | `string` | Path to which critical CSS should be output | Current working directory |
| `outputDest` | `string` | Default critical CSS file name | `"critical.css"` |
| `preserve` | `boolean` | Whether or not to remove selectors from primary CSS document once they've been marked as critical. This should prevent duplication of selectors across critical and non-critical CSS. | `true` |
| `minify` | `boolean` | Minify output CSS? | `true` |
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