I have been running System.Web.Optimization
successfully for several months and all has been great.
I am currently adding CKEditor to my website and I ran into an issue.
Background:
CKEditor has it's own ckeditor.js file. They also include a jquery 'plugin' which allows us to use jquery to interact with their objects.
Problem:
I decided to create a separate bundle containing these two files to include whenever I need to use them, this way I have have to always include both files. Here's what I got:
bundles.Add(new ScriptBundle("~/ckeditor.js").Include(
"~/js/ckeditor/ckeditor.js",
"~/js/ckeditor/adapters/jquery.js));
I noticed the output (when debug="true"
) was out of order:
<script src="/js/ckeditor/adapters/jquery.js"></script>
<script src="/js/ckeditor/ckeditor.js"></script>
After some research I found nothing except some class(es)/function(s) to create which will preserve the order -- How can I specify an explicit ScriptBundle include order?, -- but I tested something locally and found that all files with jquery
in them are automatically place at the top.
Question:
I figured I could rename the jquery file, but if there is another way, I'd rather not. Not just for practicallity, where I have to remember that I renamed it for future updates to CKEditor, but also for my own knowledge (I like to know as much as I can, not just the how's but also the what's, why's, when's, you get the deal). Is there a way, without going through the class/function methods, to prevent jquery
named files from jumping to the top?