Bundling and minification without ASP.NET MVC

前端 未结 6 1198
遥遥无期
遥遥无期 2020-12-13 14:17

Is it possible to use bundling and minification from Microsoft.AspNet.Web.Optimization without having an MVC project?

I\'m creating an AngularJS site communicating w

6条回答
  •  既然无缘
    2020-12-13 14:58

    @Matt, actually you don't need to add

    <%@ Import Namespace="System.Web.Optimization" %>
    <%= Styles.Render("~/bundles/css") %>
    <%= Scripts.Render("~/bundles/MattsUIBundle/js") %>
    

    And you don't need use CSHTML-template. You can reference your bundles this way from an html page:

    
    
    

    It will save your page from View Engine.

提交回复
热议问题