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

Re : Can you use a page's existing jQuery in steal?

$
0
0
Justin thank you so much for responding but I still can't get past that error when building. 

Here is my stealconfig.js:

  1. steal.config({
        map: {
            "*": {
                "jquery/jquery.js" : "jquery",
                "can/util/util.js": "can/util/jquery/jquery.js"
            }
        },
        paths: {
            "jquery": './jquery.js'
        },
        shim : {
            jquery: {
                exports: "jQuery",
                ignore: true
            }
        },
        ext: {
            js: "js",
            css: "css",
            ejs: "can/view/ejs/ejs.js"
        }
    })

Here is my dummy jquery.js:

  1. steal(function() {
        return window.jQuery;
    })

Here is my buildjs result:

  1. Building to
      opening postviewer/postviewer.js
    !!!!!!!!!!! ERROR !!!!!!!!!!!

    -message    = Cannot call method "extend" of undefined
    -fileName   = file:////web/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

I hope I'm not being a total idiot here.  My build command is:

  1. ./js steal/buildjs postviewer

I've also tried building with a dummy html page.  I think this is how jmvc worked a while back.

  1. ./js steal/buildjs postviewer/postviewer.html

This file simply includes jquery, twitter bootstrap js, and my main can app in that order.  It looks like it's working for a sec but outputs:

  1. Building to postviewer/
      opening postviewer/postviewer.html

No files are created and no errors are returned.  I thought maybe this might work but I'm shooting in the dark at this point.

I know you guys are busy and I don't want all of this to sound like a lazy, whiny diatribe...but i firmly believe there needs to be a solid bridge in place to connect the jquery+bootstrap "environment" with your amazing js awesome sauce.  There is nothing suckier than creating bad-ass-ness with CanJS and realizing your dependency management is holding you up.  (also, steal is awesome...just. want. moar.) 


Viewing all articles
Browse latest Browse all 3491

Latest Images

Trending Articles



Latest Images