I recenly learnt that i can bundle my scripts js/css for a better and optimized performance. I tried to implement this with my mvc project but the scripts aren't rendering. I added my bundleconfig class under App_Start like below.
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/Content/bundles/js").Include(
"~/Content/js/jquery.min.js",
"~/Content/js/bootstrap.min.js",
"~/Content/js/JobWebSite.js",
"~/Content/js/bootstrap-datetimepicker.min.js",
"~/Content/js/bootstrap-filestyle.min.js"
));
bundles.Add(new StyleBundle("~/Content/bundles/css").Include(
"~/Content/css/style.css",
"~/Content/css/bootstrap.min.css",
"~/Content/css/bootstrap-datetimepicker.min.css",
"~/Content/css/social-buttons.css",
"~/Content/css/font-awesome.min.css"
));
}
}
Note: new ScriptBundle("Viturtual path"). Please what should the virtual path be? I created a new folders and assigned them as my virtual path. I was expecting to see some files to be created after the bundling yet the folder is still empty. In my Global.asx, i added the line below.
JobWebSite.WebUI.App_Start.BundleConfig.RegisterBundles(System.Web.Optimization.BundleTable.Bundles);
I try to render my bundle from my LayoutPage
@Scripts.Render("~/Content/bundles/cs")
As i have seen some where but nothing is rendering. Also my vitual path is still empty . Please what am i missing ? Any better tut or explanation would be appreciated.