Minification failed. Returning unminified contents

前端 未结 12 2124
清酒与你
清酒与你 2020-12-24 11:24

I have made my first website using MVC 5 which works fine on my local machine but when I publish it to the server some of the CSS is not minifying correctly.



        
12条回答
  •  梦谈多话
    2020-12-24 12:26

    What I did was, in my BundleConfig.vb (cs), I put all the files I referenced by @import within the css files like this:

    bundles.Add(New StyleBundle("~/bundle/css-account") _
                    .Include("~/Content/consola/bootstrap/css/bootstrap.css",
                             "~/Content/consola/plugins/node-waves/waves.css",
                             "~/Content/consola/plugins/animate-css/animate.css", //Referenced by @import
                             "~/Content/consola/plugins/bootstrap-select/css/bootstrap-select.css",
                             "~/Content/account/account.css",
                             "~/fonts/awesome/css/font-awesome.css",//Referenced by @import
                             "~/Content/consola/materialize.css", //Referenced by @import
                             "~/Content/consola/style.css"))
    

    That eliminated almost all the errors.

    The next thing I did was modify my css files changing css pseudo-classes syntax from this [type="checkbox"]:not(.filled-in, .gm-menu-hamburger) + label:after { to this one [type="checkbox"]:not(.filled-in) + label:after, [type="checkbox"]:not(.gm-menu-hamburger) + label:after {

    That solved all errors I had.

    Hope that helps

提交回复
热议问题