Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

StealJS: Can production.js be built dependent on window.jQuery? How so?

$
0
0
I guess I will try rewording this in a brand new post.  Very vanilla website has existing jQuery and bootstrap $.fn plugins.  Need to build production.js that is CanJS app which depends on window.jQuery.  Can't build, I'm assuming because the physical jquery must exist to build, but this is counterproductive as now $.fn is written anew.

TL;DR Is there any way to build a production.js that depends on window.jQuery; without overwriting a page's existing jQuery instance?

building normally causes this very obvious error:

  1. !!!!!!!!!!! ERROR !!!!!!!!!!!

    -message    = Cannot call method "extend" of undefined
    -fileName   = file:////Users/admin/Documents/Web/gangframe/public/js/apps/can/util/jquery/jquery.js
    -lineNumber = 2
    -name       = TypeError

                  error loading html element  [object HTMLScriptElement]   TypeError: Cannot call method "extend" of undefined
There used to be this way to use steal to build with a dummy html file.  I believe this is what I need however I can find no reference to it.

Here is my dummy jquery.js that I map to in my stealconfig.js.  Works great in development mode, of course:
  1. steal(function() {
        return window.jQuery;
    })

Is there any way to build a production.js that depends on window.jQuery; without overwriting a page's existing jQuery instance?



Viewing all articles
Browse latest Browse all 3491

Trending Articles