In a .NET MVC4 project how does @Styles.Render works?
I mean, in @Styles.Render(\"~/Content/css\") which file is it calling?>
A bit late to the party. But it seems like no one has mentioned
bundling & minification of StyleBundle, so..
@Styles.Render("~/Content/css")
calls in Application_Start():
BundleConfig.RegisterBundles(BundleTable.Bundles);
which in turn calls
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/Site.css"));
}
RegisterBundles() effectively combines & minifies bootstrap.css & Site.css
into a single file,
But..
only when debug is set to false in Web.config.
Otherwise bootstrap.css & Site.css will be served individually.
Not bundled, nor minified: