虚拟主机不支持 .less 文件扩展名
我在我的 MVC 应用程序上使用 lesscss.org 的样式。
它工作得很好,但不幸的是我的网络主机不支持 .less
文件扩展名,他们也不会添加支持。
虽然 LessCSS 使用 JavaScript,但肯定有一种方法可以将我的 CSS 文件从 site.less 重命名为 site.css,并更改 JavaScript 以使用 .css 扩展名而不是 .less 扩展名。
请注意,我没有使用 dotLess,并且在发布之前进行编译也不是我想要的。
I am using lesscss.org's styles on my MVC application.
It works great, but unfortunately my web host does not support .less
file extensions, neither will they add support.
Seeing though LessCSS makes use of JavaScript, surely there must be a way to rename my CSS file from site.less to site.css and change the JavaScript to make use of the .css extension instead of the .less extension.
Please note I am not using dotLess, and compiling prior to release is also not what I am looking for.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
终于成功了。
我所要做的就是修改我的 MVC web 应用程序 的 web.config 并添加以下内容:
我将网站重新发布到我的托管提供商 afrihost,它的墙工作得很好。
Finally got it working.
All i had to do is modify my web.config of my MVC web application and add the following:
I re-published the site to my hosting provider afrihost, and it wall worked perfectly.
该脚本似乎只寻找
stylesheet/less
rel。据我所知,文件扩展名并不重要。为了澄清,将 styles.less 重命名为 styles.css 并使用以下代码应该可以工作:
The script appears to only be looking for the
stylesheet/less
rel. As far as I can tell, the file extension doesn't matter.To clarify, renaming styles.less to styles.css and using the following code should work:
只需在本地转换为 css,然后上传即可。
从使用页面:
http://lesscss.org/#-client-side-usage
你可以通过 < code>-x 用于缩小。
Simply convert to css locally before you upload it.
From the usage page:
http://lesscss.org/#-client-side-usage
You can pass
-x
for minification.