Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在从两个本地 URL 提供一个站点..
localhost/mysite(使用别名)
local.mysite.com(使用虚拟主机)
它们指向同一个目录。但是,第一个可以很好地编译我的 .less 文件,而第二个则不能。有谁知道为什么会这样?
看起来 Less 对开发和生产环境有不同的优化规则。它将开发环境定义为从“localhost”、“127.0.0.1”或“0.0.0.0”提供的任何内容,而其他所有内容都被视为生产环境。由于我的虚拟主机使用不同的域,Less 将其视为 prod 环境,并且不会不断地重新解析 .less 文件。