mperdeck/dynamicbundles

Engine does not search folders in views.

Opened this issue · 4 comments

Hi, great engine.

My only concern is that it does not seem to search folders within views for css/js files. - is this by design While i can work around this with the dependencies.nuspec file, it would be nice to add this functionality to the engine.

I use the folders to Organize the diferent files i need, for example the _Layout has alot of content files i need to serve (JQuery, Plugins, Custom, Fonts [Css], etc) which are organised into folders.

Edit:

I've noticed now that the engine seems to fail if the dependency does not lie within the view folder. So i cannot reference files in the regular Mvc Content folder. I've also noticed that i cannot look forward in folder for dependencies. For example if the dependencies.nuspec file is in _LayoutContainer, and the dependency lies in _LayoutContainer/SomeDirectory the engine fails.
In the first case i get a "The path is not of a legal form." error and in the second cases The @DynamicBundlesTopRender() has a stackOverflowException.

Im also having issues with ordering the scripts and css and such. How would you suggest this is best done.

Thanks Matt

You could always manually define one or more bundles just for the _Layout, and use Dynamic Bundles for everything else.

@rlenders , so basically I can still combine the classic bundling together with the dynamic bundling? I'd us classic bundling for the common layout bundles, and use the Dynamic Bundles for my single CSS and JS files per View.

Yes you can do that. That's exactly how I'm using bundles right now!

@rlenders Do you happen to have a GitHub repo which does that? Once you take out BundleConfig.RegisterBundles(BundleTable.Bundles); and add ViewEngines.Engines.Add(new DynamicBundles.DynamicBundlesViewEngine()); I thought you loose all the classic bundling capabilities and have to reorganize everything. I'd need to get rid of all of my JS library NuGet packages and transition to bower, since right now they all install JS files into the Scripts directory directly. With Dynamic Bundles you can refer to that directory as external directory but all JS files in there would be bundled. In my case I don't use Jquery, knockout, ... etc on all of my pages, so I need granularity there. Can we chat somewhere?