/
DiagnosticBundleConfiguration.cs
30 lines (27 loc) · 1.21 KB
/
DiagnosticBundleConfiguration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Linq;
using System.Reflection;
using Cassette.IO;
using Cassette.Scripts;
namespace Cassette.Aspnet
{
public class DiagnosticBundleConfiguration : IConfiguration<BundleCollection>
{
readonly IBundleFactory<ScriptBundle> scriptBundleFactory;
public DiagnosticBundleConfiguration(IBundleFactory<ScriptBundle> scriptBundleFactory)
{
this.scriptBundleFactory = scriptBundleFactory;
}
public void Configure(BundleCollection bundles)
{
var scriptBundle = scriptBundleFactory.CreateBundle(
"~/Cassette.Aspnet.Resources",
Enumerable.Empty<IFile>(),
new BundleDescriptor { AssetFilenames = { "*" } }
);
scriptBundle.Assets.Add(new ResourceAsset("Cassette.Aspnet.Resources.jquery.js", Assembly.GetExecutingAssembly()));
scriptBundle.Assets.Add(new ResourceAsset("Cassette.Aspnet.Resources.knockout.js", Assembly.GetExecutingAssembly()));
scriptBundle.Assets.Add(new ResourceAsset("Cassette.Aspnet.Resources.diagnostic-page.js", Assembly.GetExecutingAssembly()));
bundles.Add(scriptBundle);
}
}
}