Skip to content
New issue

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

Empty <style> tag rendered for some CSS files instead of correct <link> tag #334

Open
0liver opened this issue Sep 8, 2016 · 1 comment

Comments

@0liver
Copy link
Contributor

0liver commented Sep 8, 2016

We minify our css files like this:

var path = "/Themes/One/Styles/one.css";
var name = "one";
@MvcHtmlString.Create(Bundle.Css().Add(path).Render(string.Format("~/bdls/{0}_#.css", name))

Unfortunately, for some of our files we get the output <style></style> instead of the desired <link href="/bundles/theme_ABCDEFG.css" rel="stylesheet" type="text/css" />. This is very weird and it is dependent on the css file being processed by the SquishIt.

I would like to understand where in the processing pipeline the error occurs but I have no clue where and how to configure SquishIt to tell me more about that. Is logging available? Exceptions? Anything?

By the way, trying to use the NullMinifier helped in getting the <link /> rendered, but the referenced file was empty.

@AlexCuse
Copy link
Collaborator

AlexCuse commented Sep 8, 2016

What version are you using? What minifier? (default is AjaxMin).

I have not seen this, and would probably need a project to reproduce it.

You might want to try using the YUI minifier, I've personally had much better results with it.

Bundle.ConfigureDefaults().UseYUIForCssMinification()

The only place I know of where we intentionally render style tags is when debugging - if arbitrary content is included in a bundle and maybe embedded resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants