postcss-critical-css
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -167,3 +167,3 @@ 'use strict'; | ||
function buildCritical(options) { | ||
var args = Object.assign({ | ||
var args = Object.assign({}, { | ||
outputPath: process.cwd(), | ||
@@ -173,4 +173,3 @@ preserve: true, | ||
dryRun: false | ||
}, options || {}); | ||
}, options); | ||
return function (css, result) { | ||
@@ -200,3 +199,3 @@ var criticalOutput = getCriticalRules(css, args.preserve); | ||
if (!args.dryRun) { | ||
fs.writeFile(path.join(args.outputPath, fileName), result); | ||
fs.writeFileSync(path.join(args.outputPath, fileName), result); | ||
} else { | ||
@@ -203,0 +202,0 @@ console.log(chalk.green('\nCritical CSS result is:\n' + chalk.yellow(result.css))); |
{ | ||
"name": "postcss-critical-css", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Generate critical CSS using PostCSS", | ||
@@ -25,8 +25,11 @@ "main": "index.js", | ||
"cssnano": "^3.5.2", | ||
"postcss": "^5.0.5" | ||
"postcss": "^5.0.5", | ||
"tape": "^4.6.0" | ||
}, | ||
"scripts": { | ||
"build": "babel src/index.js --out-file index.js", | ||
"start": "babel src/index.js --out-file index.js --watch" | ||
"start": "babel src/index.js --out-file index.js --watch", | ||
"pretest": "./node_modules/.bin/babel-node test/preTest.js", | ||
"test": "npm run pretest && tape test" | ||
} | ||
} |
@@ -178,3 +178,2 @@ 'use strict'; | ||
for (let fileName in criticalOutput) { | ||
console.log(fileName); | ||
let criticalCSS = postcss.parse(''); | ||
@@ -181,0 +180,0 @@ let critical = ''; |
Sorry, the diff of this file is not supported yet
16355
12
424
7
4