有没有可能使用正则表达式来转换CSS文件中的URL,就像下面示例的方式一样?我不想硬编码字体名称。
从:
url('../fonts/glyphiconshalflings-regular.eot?#iefix') format('embedded-opentype')
to:
url("#{resource['css:../fonts/glyphiconshalflings-regular.eot']}?#iefix") format('embedded-opentype')
这是我目前拥有的内容:
task fixCSSResources << {
FileTree cssFiles = fileTree("src/main/webapp") {
include "**/*.css"
}
cssFiles.each { File cssFile ->
String content = cssFile.getText("UTF-8")
// what to do here?
cssFile.write(content, "UTF-8")
}
}
url(something) format(something)
的格式? - Song Gao