I've just started using Chirpy (Both v2.01 and v2.03 - http://chirpy.codeplex.com/), and whilst it works great with .js and .css files, I'm having a bit of trouble with any Razor Syntax in VS 2010.
Essentially, I have a Razor file which looks like follows:
@{ ViewBag.Title = "Blah"}
@section Styles{ ... }
@section Scripts{ ... }
html
In various places I use @foreach loops, and use a either "@:" or to notify what is code and what is to be output.
All said and done, Chirpy gives me hundreds of errors. They are all either:
Error 60 "missing name after .@"
Error 62 "syntax error"
Error 63 "invalid property id"
Error 67 "missing ; before statement"
Error 68 "illegally formed XML syntax"
There are actually no problems in the cshtml files as they all run perfectly in firefox/chrome with no errors.
Could anyone help? Would love some inline js minification if it's available.
I have posted this query on the codeplex site also (and will report back if I get a response): http://chirpy.codeplex.com/discussions/283079
If all else fails, I'll jump into the code (it's open source). Anyone offer a better place to start than here: http://chirpy.codeplex.com/SourceControl/changeset/view/d003dad47915#Engines%2fViewEngine.cs ?
Cheers, Daz.
As far as I can see from the code, Chirpy is using its "regular" conversion engines to minify the CSS and JS.
This means the minifying engines doesn't know razor. So you cannot use razor code, that could be mis-interpreted by the minifying engine. This pretty much excludes everything.
Actually, this does make a lot of sense, since the minifier can only work on expanded code, something like this, just cannot be "minified" (same is true for .less / css):
<script>
@for(int i = 0; i < 10: i++) {
var k@i = @(i * i);
}
alert(k@(variable_from_razor));
</script>