We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like support for ordering when concatenating files. I still have old Javascript files in which the order is important.
Something like: .Concatenate(path=> path.Contains("module.js") ? 2 : 1)
.Concatenate(path=> path.Contains("module.js") ? 2 : 1)
The Concatenator class can be modified to use:
internal class Concatenator : Processor { private Func<int>? _pathPriorityFunc = null; public Concatenator(Func<int>? pathPriorityFunc = null) { _pathPriorityFunc = pathPriorityFunc; } public override Task ExecuteAsync(IAssetContext context) { var sb = new StringBuilder(); var keys = _pathPriorityFunc != null ? context.Content.Keys.Order(Comparer<string>.Create(Compare)) : context.Content.Keys; foreach (var k in keys) { sb.AppendLine(context.Content[k].AsString()); } .... private static int Compare(string x, string y) { int prioX = _pathPriorityFunc(x); int prioY = _pathPriorityFunc(y); if (prioX < prioY) return -1; if (prioX > prioY) return 1; return 0; }
The text was updated successfully, but these errors were encountered:
README mentions order preservation for CSS at least. Not sure if it is meant to work with JS.
Sorry, something went wrong.
No branches or pull requests
I would like support for ordering when concatenating files. I still have old Javascript files in which the order is important.
Something like:
.Concatenate(path=> path.Contains("module.js") ? 2 : 1)
The Concatenator class can be modified to use:
The text was updated successfully, but these errors were encountered: