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

Use cases and load ordering #155

Open
craigs100 opened this issue May 18, 2022 · 0 comments
Open

Use cases and load ordering #155

craigs100 opened this issue May 18, 2022 · 0 comments

Comments

@craigs100
Copy link
Contributor

I may have been using Smidge wrong but I've spent most of the day chasing my tail so I thought I'd ask. I was upgrading an old Umbraco V7 site to V9.5. The old site's views included specific css and js files pertinent to that view using @Sections (header and footer). I thought I could just use Smidge for that. Turns out I couldn't because I had no way to control the order of loading. If JQuery was included with the Base template, then anything that needed JQuery in the child templates errorred due to lack of JQuery because they were loaded before the scripts in the Base template and I had no control over this.

  // Set up local JS
  SmidgeHelper.RequiresJs("~/scripts/slimmage.min.js");
  SmidgeHelper.RequiresJs("~/scripts/bootstrap.min.js");
  SmidgeHelper.RequiresJs("~/scripts/common.js");

Then in the Master template

@await SmidgeHelper.JsHereAsync()

Would it be possible to include an index number to control the loading order?
Or, have I just made some silly assumptions? For now, I decided not to use Smidge on this project and have reverted to traditional, unbundled links to pre-minified files.

Cheers

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

1 participant