Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying jQuery Alias in Script#

Tags:

jquery

script#

Is there a way to specify the jQuery alias Script# uses when generating JavaScript? For example, if we expect our version of jQuery as “$myJQuery” using noConflict(true), is there a way to get Script# to compile all references to "$myJQuery" instead of "jQuery" when loading the generated script?

like image 689
Ed Kaim Avatar asked Nov 20 '25 18:11

Ed Kaim


1 Answers

I believe you will need to recompile the jQuery import library.

You can do so by downloading the source code at https://github.com/nikhilk/scriptsharp, then modifying jQuery.cs so that [ScriptName("$")] becomes [ScriptName("$myJQuery")].

Once recompiled, drop the jQuery dll into your Script# project folder and re-add the jQuery reference using your new dll instead of the stock dll.

like image 156
DuckMaestro Avatar answered Nov 23 '25 11:11

DuckMaestro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!