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
Getting dependencies from the Web myself looks like implementing it one more time. Is there a better way?
var fileProvider = environment.ContentRootFileProvider; var httpClient = new Lazy<HttpClient>(); var options = new WebOptimazerScssOptions { TryImport = (ref string file, string parentPath, out string scss, out string map) => { map = String.Empty; var uri = new Uri(file, UriKind.RelativeOrAbsolute); if (uri.IsAbsoluteUri && (uri.Scheme.Equals("http", StringComparison.OrdinalIgnoreCase) || uri.Scheme.Equals("https", StringComparison.OrdinalIgnoreCase))) { scss = httpClient.Value.GetStringAsync(uri).Result; return true; } var fileName = Path.GetFileName(file); var path = Path.GetDirectoryName(file); var filePath = $"{path}/_{fileName}.scss"; var fileInfo = fileProvider.GetFileInfo($"Areas/SecretCircle.BmwTheme/wwwroot/styles/{filePath}"); if (fileInfo is Microsoft.Extensions.FileProviders.NotFoundFileInfo) { scss = String.Empty; return false; } else { using var reader = new StreamReader(fileInfo.CreateReadStream()); scss = reader.ReadToEnd(); return true; } } };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Getting dependencies from the Web myself looks like implementing it one more time.
Is there a better way?
The text was updated successfully, but these errors were encountered: