Closed kamranayub closed 12 years ago
Thanks for the detailed analysis. Cassette may be getting confused by the stylesheet bundle directory containing the script bundle directories. I have been concerned that overlapping bundles could cause problems.
Your scenario sounds like an integration test we need to add!
Re: the first issue. The order of bundle definition shouldn't matter. References external to a bundle are not resolved until all the bundles have been added. Did you also update the in-script references after moving the file?
If you're able, please email me a project that reproduces these issues. Or even better a pull request with some failing tests. Thanks! :)
Did you also update the in-script references after moving the file?
Do you mean in the app.js file? I tried these combinations of @reference
calls:
// @reference vendor
/// <reference path="vendor" />
/// <reference path="~/public/scripts/vendor" />
None seemed to work.
I am leaving this weekend but when I get back I should be able to create a simple test case. I will be running into this issue again for my other project since I have adopted this same file structure, so I can test with that project as well.
Ah okay, I think I misunderstood you before. Let's pick this up again after the holiday. Have a good one! :)
-----Original Message----- From: Kamran Ayub Sent: 23/12/2011 13:54 To: Andrew Davey Subject: Re: [cassette] Cassette does not properly include a bundle for one file (#121)
@kamranayub can you grab the latest from master and see if it's now working for you?
I pulled latest and built the release DLL and copied it over into a new branch and tested. It works! The only other issue I can see is how I can't reference my Google fonts via the alias "Fonts" in layout.css, but I believe that's a separate issue and maybe even not a feature yet.
Once the latest Nuget release is out, I'll update my tutorial with the new information. Thanks for looking at this!
Thanks! I'll be getting a patch release out soon that will include this fix.
Re: fonts alias - can you create another issue for that please?
Sure thing!
Fixed in v1.0.1
I ran into an issue that took me awhile to figure out (work around?).
Given this file structure:
I create bundles like this:
There are two issues:
public/scripts
folder in_Layout.cshtml
, it will not include App.jsVendor files are included fine but App.js never gets included.
I have tried adding each folder manually, or simply removing vendors and only trying to create a bundle for App.js. No approach worked for me.
What ended up "fixing" the issue was just directly referencing App.js in the layout:
Then it properly included the file. I don't like this simply because now it will not auto-include any new JS files put into that folder.
Is there any code that says if a bundle contains 1 file, it can't be referenced like that (via parent folder)? I checked _cassette the entire time I ran into this problem, and it was detecting app.js and adding it to a bundle:
Could it be how the folder structure is laid out? Maybe a path comparison or something is failing when it shouldn't be.
For issue 1 above, how are dependencies graphed? Sub-folders first, then top-level folder? Or top-level folder first, then sub-folders? If it's the latter, it's obvious why it failed on App.js (because Vendor bundle wasn't made yet). However, when I made the Vendor bundle first in the configuration, then the top-level-only (using a custom
FileSearch
), it still failed to find the vendor bundle. Not sure what's going on there.I just wanted to document what happened to me. Things are working using the above workaround, although I still can't reference anything in app.js.