我今天早上找到了Grunt Combine Media Queries插件,并且一直在考虑让它在我的构建中运行,因为我们的 CSS(204 - 我们正在使用 SASS)中有大量愚蠢的媒体查询声明,我想要减少。
cmq: {
options: {
log: true
}
, your_target: {
files: {
'<%= meta.cssPath %>temp': ['<%= meta.cssPath %>hayes.css']
}
}
}
cssPath 只是 CSS 所在的目录。
当我运行 grunt cmq 时,出现以下错误:
Processed media queries:
@media screen and (-webkit-min-device-pixel-ratio: 0)
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)
@media only screen and (min-device-pixel-ratio: 2)
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi)
@media (max-width: 767px) and (min-width: 768px)
@media (min-width: 768px) and (max-width: 979px)
@media (min-width: 768px)
@media (min-width: 768px) and (max-width: 767px)
@media (min-width: 768px) and (max-width: 767px) and (max-width: 767px)
@media (min-width: 768px) and (min-width: 1200px)
@media (min-width: 979px)
@media (min-width: 980px) and (max-width: 1200px)
@media (min-width: 1200px)
@media (max-width: 980px)
Warning: Cannot call method 'join' of undefined Use --force to continue.
Aborted due to warnings.
有没有人有类似的情况或知道是什么原因造成的?我正在运行 Grunt 0.4.1。