本文介绍了SquishIt.Less ProcessIncludes()不工作的CSS文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Less文件,其中包括一个CSS文件,然后一组Less文件。使用SquishIt我想合并和缩小这些,但它忽略CSS文件,除非我重命名为.css.less。我相信ProcessIncludes()是为了这个目的,但没有什么区别。

I have a Less file which includes a CSS file, then a set of Less files. With SquishIt I want to combine and minify these, but it ignores the CSS file unless I rename it to .css.less. I believe ProcessIncludes() is intended for this purpose but makes no difference.

有没有人知道为什么ProcessIncludes()文件?

Does anyone know why ProcessIncludes() doesn't do anything on a CSS file linked in a Less file?

(这是后续: Squishit.Less不工作,它现在适用于Less文件。)

(This is a follow up to: this question about Squishit.Less not working at all, it now works for the Less files.)

推荐答案

dotLess有一个配置选项InlineCssFiles,我相信你所需要的。您可以使用自己的配置,通过在较少的预处理器上覆盖静态属性EngineBuilder(它的一个Func)。所以在App_Start中你可以这样做:

There is a configuration option for dotLess called "InlineCssFiles" that I believe does what you need. You can use your own configuration by overriding the static property "EngineBuilder" (its a Func) on less preprocessor. So in App_Start you could do something like this:

LessPreprocessor.EngineBuilder = () => new EngineFactory
            {
                Configuration = new DotlessConfiguration
                    {
                        InlineCssFiles = true,
                    }
            }.GetEngine();

这篇关于SquishIt.Less ProcessIncludes()不工作的CSS文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 23:16