我可以通过lessc命令将其编译为CSS。如果我以崇高的态度打开输出文件,则看起来不错:

/*!
 * Bootstrap v3.3.6 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
html {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
...


但是,当我在chrome中打开文件时(直接通过导航到它或通过devtools检查它),

.heasder { test.}����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
...


这持续约100行,然后CSS正常恢复。 .heasder{ test...位来自我测试时。它不再存在于任何文件中,更不用说被编译成更少文件的文件了。目前,我正在尝试找出这个文件时,我的less文件实际上只是@import "bootstrap/bootstrap.less";

我尝试通过npmapt-get重新安装较少的编译器,没有骰子。我还应该提到,在chrome中打开devtools时,我已禁用了缓存。

最佳答案

问题出在nginx的sendfile配置上。有关详细说明,请参见here

关于css - nginx或更少,输出未知字符,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37063011/

10-09 18:23
查看更多