Skip to content

Commit

Permalink
fix:路径normalize
Browse files Browse the repository at this point in the history
  • Loading branch information
cnt1992 committed Dec 4, 2015
1 parent 9546a32 commit f6aa74c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ var gulp = require('gulp'),
cssnano = require('cssnano'),
yaml = require('js-yaml'),
fs = require('fs'),
cfg = yaml.safeLoad(fs.readFileSync('_config.yml'));
cfg = yaml.safeLoad(fs.readFileSync('_config.yml')),
path = require('path');

require('shelljs/global');

Expand Down Expand Up @@ -33,6 +34,7 @@ gulp.task('useref', ['hexo'], function(){
.pipe($.useref({
searchPath:'public',
transformPath: function(filePath) {
filePath = path.normalize(filePath);
return filePath.replace(dirs.public + cfg.root, dirs.public + '/');
}
}))
Expand Down

0 comments on commit f6aa74c

Please sign in to comment.