I am creating an AngularJS site communicating with a REST API. For the REST API I'm using ASP.NET Web API. I have also created an "ASP.NET Empty Web Application". There are only HTML, js and CSS files in this project (and a web.config). I'd like for my js and CSS files to be bundled and minified, but I don't want to add minified files into index.cshtml. Is it possible?
can any one say how to add minified files into index.html.
steps i have followed.
1.Installing package.
Install-Package Microsoft.AspNet.Web.Optimization
2.Created a BundleConfig Class and bundles:
using System.Web.Optimization;
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle(new ScriptBundle("~/MyApp/Main")
.Include("~/MyApp/app.js")
.Include("~/MyApp/SampleController.js"));
}
}
3.Register the BundleConfig class within the application start in the global.asax
void Application_Start(object sender, EventArgs e)
{
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
now I want to refer the Main.js into my application.can I be able to add main.js into my index.html,if yes How?
Is it neccessary that I have to create .cshtml and then refer main.js using
@script.Render
Have any other way to bundle and minify my files other than asp.net mvc??