cssdream / cssgrace

从今天起,写简单优雅面向未来的 CSS。From now on,writing brief,elegant,future-oriented CSS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

sudosiyang opened this issue · comments

commented

如果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,还是我需要哪些配置可以避免?

Done, Fix it. 1dd9a90

非常感谢。