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

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

$
0
0
Working on a very simple app with Can and using Steal for dependency management.  Everything seems fine except something is trying to load jquery/jquery.js from my main jmvc project directory.  I'm assuming it's steal trying to load this?

I started reading the Steal documentation but it is so scattered.  For instance, what is an "id"?  Is this documented? 

I'm so confused about Steal.map:
The following maps jquery/jquery.js to jquery-1.8.3.js in filemanager
Is filemanager an app name?

mapConfig is a map of a "require-er" moduleId to a mapping of ids like:

Still no idea what "ids" are.  What is a moduleId?  Maybe this doesn't matter to me?

I want to have multiple apps share one directory.  I've created /js/jmvc/canjs and /js/jmvc/steal and built steal and now have /jmvc/stealconfig.js.  Here are the contents of my stealconfig.js.  I've tried to modify things but I'm flying blind as I cannot, for the life of me, understand virtually any of the Steal docs.  Are these documents for Steal contributors only?

  1. steal.config({
        map: {
            "*": {
                // "../jquery.min.js" : "jquery",
                "can/util/util.js": "can/util/jquery/jquery.js"
            }
        },
        paths: {
            "jquery": "/js/jquery.min.js" // this is where my regular ol' jquery is shared by my whole site, even pages that will never have a canjs app or steal or anything.
        },
  2. // "It accepts an object map of moduleId property names to options."  clueless.
        shim : {
            jquery: {
                exports: "jQuery" // no idea what is going on here...
            }
        },
  3.       // I think I understand ext, at least...
        ext: {
            js: "js",
            css: "css",
            less: "steal/less/less.js",
            coffee: "steal/coffee/coffee.js",
            ejs: "can/view/ejs/ejs.js",
            mustache: "can/view/mustache/mustache.js"
        }
    })




Viewing all articles
Browse latest Browse all 3491

Trending Articles