本文介绍了找不到BundleTransformer LibSass错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 BundleTransformer .我已经按照文档中所述的所有步骤进行操作,但是仍然无法正常工作.

I want to use BundleTransformer. I've followed all the steps stated in the docs, but still don't work.

我已经安装:

  • BundleTransformer.SassAndScss
  • BundleTransformer.Autoprefixer
  • LisSassHost
  • LibSassHost.Native.win-x64
  • JavaScriptEngineSwitcher.V8

这是我的配置:

<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
    <autoprefixer cascade="true">
        <jsEngine name="V8JsEngine" />
        <browsers>
            <add conditionalExpression="&gt; 5%" />
            <add conditionalExpression="last 2 versions" />
        </browsers>
    </autoprefixer>
    <sassAndScss>
        <includePaths>
            <add path=""></add>
        </includePaths>
    </sassAndScss>
    <core>
        <css defaultPostProcessors="UrlRewritingCssPostProcessor,AutoprefixCssPostProcessor">
            <translators>
                <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />
                <add name="SassAndScssTranslator" type="BundleTransformer.SassAndScss.Translators.SassAndScssTranslator, BundleTransformer.SassAndScss" />
            </translators>
            <postProcessors>
                <add name="UrlRewritingCssPostProcessor" type="BundleTransformer.Core.PostProcessors.UrlRewritingCssPostProcessor, BundleTransformer.Core" useInDebugMode="false" />
                <add name="AutoprefixCssPostProcessor" type="BundleTransformer.Autoprefixer.PostProcessors.AutoprefixCssPostProcessor, BundleTransformer.Autoprefixer" useInDebugMode="true" />
            </postProcessors>
            <minifiers>
                <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
            </minifiers>
            <fileExtensions>
                <add fileExtension=".css" assetTypeCode="Css" />
                <add fileExtension=".sass" assetTypeCode="Sass" />
                <add fileExtension=".scss" assetTypeCode="Scss" />
            </fileExtensions>
        </css>
        <js>
            <translators>
                <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />
            </translators>
            <minifiers>
                <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
            </minifiers>
            <fileExtensions>
                <add fileExtension=".js" assetTypeCode="JavaScript" />
            </fileExtensions>
        </js>
    </core>
</bundleTransformer>

并注册V8引擎:

// JsEngineSwitcherConfig.js
public class JsEngineSwitcherConfig {
    public static void Configure(JsEngineSwitcher engineSwitcher) {
        engineSwitcher
            .EngineFactories
            .AddV8();

        engineSwitcher.DefaultEngineName = V8JsEngine.EngineName;
    }
}

// Global.asax
JsEngineSwitcherConfig.Configure(JsEngineSwitcher.Instance);

经过一些固定的麻烦之后,我的最后一个错误是:

After some fixed troubles, my last error is this:

我认为这与以下方面有关:

I Think this has something to do with:

但是,我不知道如何要求该dll.

But, I don't know how to require that dll.

或者实际上我不知道真正的问题在哪里,如果有人可以帮助我,我将不胜感激.

Or indeed I don't know where the real problem is, I'll appreciate if anyone can help please.

推荐答案

好了,稍作尝试后,我就安装了LibSassHost.Native.win-x86,它可以正常工作.

Well, after trying a little, I just installed LibSassHost.Native.win-x86, and it worked.

现在我有两个软件包x64和x86,一切正常.

Now I have the two packages x64 and x86, everything is working fine.

这篇关于找不到BundleTransformer LibSass错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 23:15