cssdream / cssgrace

从今天起,写简单优雅面向未来的 CSS。From now on,writing brief,elegant,future-oriented CSS.
MIT License
592 stars 63 forks source link

如果css 图片路径加了query会导致出错 #15

Closed sudosiyang closed 9 years ago

sudosiyang commented 9 years ago

如果css这么写

.test{
    background: url(../images/font/blue.png?__sprite) no-repeat;
}

会导致如下错误

no such file or directory 'xxx/application/views/statics/images/font/blue.png?__sprite'

ps:该query为构建工具合并为雪碧图之用

我做了如下修改

//获取css文件中的资源的绝对地址
function getAbsolutePath(sourcePath) {
  return path.resolve(currentFilePath, sourcePath.split("?")[0]);
}

可行。。 @yisibl 不知这是BUG,还是我需要哪些配置可以避免?

yisibl commented 9 years ago

Done, Fix it. https://github.com/cssdream/cssgrace/commit/1dd9a90508ac8fd61d3e9811e4d1a1fb93543f5f

非常感谢。