-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCompileLessWithJs.cs
More file actions
28 lines (25 loc) · 833 Bytes
/
CompileLessWithJs.cs
File metadata and controls
28 lines (25 loc) · 833 Bytes
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
using System;
using Cassette.BundleProcessing;
namespace Cassette.Stylesheets
{
public class CompileLessWithJs : IBundleProcessor<StylesheetBundle>
{
readonly ILessJsCompiler lessCompiler;
readonly CassetteSettings settings;
public CompileLessWithJs(ILessJsCompiler lessCompiler, CassetteSettings settings)
{
this.lessCompiler = lessCompiler;
this.settings = settings;
}
public void Process(StylesheetBundle bundle)
{
foreach (var asset in bundle.Assets)
{
if (asset.Path.EndsWith(".less", StringComparison.OrdinalIgnoreCase))
{
asset.AddAssetTransformer(new CompileAsset(lessCompiler, settings.SourceDirectory));
}
}
}
}
}