在远程服务器上显示 LESS.js 错误
我正在使用 LESS 的 JS 编译器在远程服务器上开发一个网站。
该编译器似乎只在本地查看站点时显示错误消息。但是,当从远程位置连接时,不会显示错误。
虽然我很理解这背后的原因,但我想知道 less.js 是否可以配置为始终显示其错误消息。
干杯!
I am developing a website on a remote server using the JS compiler for LESS.
This compiler seems to only display error messages when viewing the site locally. However, when connecting from a remote location the error is not displayed.
While I appreciate the reason behind this I am wondering if less.js can be configured to always display its error messages.
Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚查看了 less.js 文件,注意到错误消息的添加取决于 d.env 变量设置为“development”。再往下,如果 location.hostname 指示 localhost,则将该属性设置为“development”。通过将其更改为始终为真,错误将始终显示。
I just had a look in the less.js file and noticed that the adding of the error message depends on the d.env var being set to 'development'. Further down there's a bit that sets that property to 'development' if location.hostname indicates localhost. By changing this to always be true, errors will always display.
搜索
并使其像
现在出现错误一样。
为我工作。
Search for
and make it like
Errors will now appear.
Worked for me.