mirror of
https://github.com/danog/inline-critical.git
synced 2024-11-30 04:29:07 +01:00
Fixed #4
This commit is contained in:
parent
4b30bf5fda
commit
f8eed5b561
10
index.js
10
index.js
@ -16,6 +16,14 @@ var cave = require('cave');
|
||||
var reaver = require('reaver');
|
||||
var cheerio = require('cheerio');
|
||||
var CleanCSS = require('clean-css');
|
||||
var slash = require('slash');
|
||||
|
||||
/**
|
||||
* Fixup slashes in file paths for windows
|
||||
*/
|
||||
function normalizePath(str) {
|
||||
return process.platform === 'win32' ? slash(str) : str;
|
||||
}
|
||||
|
||||
module.exports = function(html, styles, options) {
|
||||
|
||||
@ -50,7 +58,7 @@ module.exports = function(html, styles, options) {
|
||||
}
|
||||
var diff = cave(file, { css: styles });
|
||||
fs.writeFileSync(reaver.rev(file, diff), diff);
|
||||
return reaver.rev(href, diff);
|
||||
return reaver.rev(normalizePath(href), diff);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,8 @@
|
||||
"cave": "^2.0.0",
|
||||
"cheerio": "^0.17.0",
|
||||
"clean-css": "^2.2.12",
|
||||
"reaver": "^1.2.0"
|
||||
"reaver": "^1.2.0",
|
||||
"slash": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "~1.8.1",
|
||||
|
Loading…
Reference in New Issue
Block a user