From acbe8e916fdebb0a2c79b97ccbdf2d20bb735e2c Mon Sep 17 00:00:00 2001 From: Viweei Date: Fri, 20 Nov 2015 23:48:12 +0800 Subject: [PATCH] Update index.js I want to use the URL to access the image path, use / than with \ better, there \ symbol will be escaped by mincss. --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 937ecbd..1cc8612 100644 --- a/index.js +++ b/index.js @@ -87,6 +87,9 @@ module.exports = function(fileName, opt) { var cssPath = path.join(firstFile.cwd, opt.cssPath, opt.prefix + gutil.replaceExtension(fileName, '.' + opt.preprocessor)); var css = json2css(sprites, {'format': opt.preprocessor}); var that = this; + + css = css.replace(/\\/g, '/'); + fs.writeFile(cssPath, css, function () { that.emit('data', sprite); that.emit('end');