I have just followed the tutorial here, which was great but the last 2 sections discuss Bundling & Minification, and Server-side rendering, respectively. Unfortunately it doesn't seem to describe how to make these two play nicely, e.g pass a script bundle to the server-side rendering function.
This is what I have so far:
BundleTable.EnableOptimizations = True
//This doesn't work and throws the following error:
//Could not find a part of the path '\\pathToMyProject\bundles\main'
//This does, but it's basically a repeat of BundleConfig
You may already have a solution by now, FWIW, here is what you can try, the first 2 steps you may have already carried out, 3rd one is what you are after...
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(YourApp), "Configure")]at the top of ReactConfig.cs
RegisterBundles()you can now insert the call to
ReactConfig.Configure();This makes sure your bundles are actually registered before trying to do anything with them.
Finally in ReactConfig.cs, Add this line
var myBabelBundlePath = BundleTable.Bundles.ResolveBundleUrl("~/myBabelBundleName"); ReactSiteConfiguration.Configuration.AddScript(myBabelBundlePath);