r.js 2.1.13 does not include dependencies in output file #1133

Closed
DanielSchaffer opened this Issue May 28, 2014 · 1 comment

Projects

None yet

2 participants

@DanielSchaffer

I've run into a problem upgrading from 2.1.11 to 2.1.13. Here's my build config file (sorry for the wall of text, and pardon the apparent disorganization - this is actually generated by a homegrown tool, and is NOT maintained by hand!):

({
    "shim": {
        "select2": ["jquery"],
        "socialvibe": {
            "exports": "socialvibe",
            "deps": ["easyXDM"]
        },
        "greensock/easing/EasePack": ["greensock/TweenLite"],
        "angular-ui-router": ["angular"],
        "angular": {
            "exports": "angular",
            "deps": ["jquery"]
        },
        "greensock/plugins/CSSPlugin": ["greensock/TweenLite"],
        "WufooForm": {
            "exports": "WufooForm",
            "deps": null
        },
        "greensock/TimelineLite": {
            "exports": "TimelineLite",
            "deps": ["greensock/TweenLite"]
        },
        "easyXDM": {
            "exports": "easyXDM",
            "deps": null
        },
        "sponsorPay": {
            "exports": "sponsorPay",
            "deps": null
        },
        "angular-ui-bootstrap": ["angular"],
        "jquery": {
            "exports": "jquery", "deps": null
        },
        "supersonicUltra": {
            "exports": "supersonicUltra", "deps": null
        },
        "angular-cookies": ["angular"],
        "greensock/TimelineMax": {
            "exports": "TimelineMax",
            "deps": ["greensock/TweenLite"]
        },
        "underscore": {
            "exports": "_", "deps": null
        },
        "angular-ui-bootstrap-tpls": ["angular"],
        "angular-file-upload": ["angular"],
        "jqueryform": ["jquery"],
        "angular-ui-select2": ["angular", "jquery", "select2"],
        "angular-animate": ["angular"],
        "angular-local-storage": ["angular"],
        "FB": {
            "exports": "FB", "deps": null
        },
        "angular-sortable": ["angular"],
        "UnityObject2": {
            "exports": "UnityObject2",
            "deps": null
        },
        "trialpay": {
            "exports": "TRIALPAY",
            "deps": null
        },
        "jscolor": {
            "exports": "jscolor",
            "deps": null
        },
        "angular-route": ["angular"],
        "greensock/TweenLite": {
            "exports": "TweenLite",
            "deps": null
        },
        "greensock/TweenMax": {
            "exports": "TweenMax",
            "deps": null
        },
        "swfobject": {
            "exports": "swfobject",
            "deps": null
        },
        "modernizr": {
            "exports": "modernizr",
            "deps": null
        },
        "jqueryui": ["jquery"],
        "twitter-bootstrap": ["jquery"]
    },
    "removeCombined": true,
    "baseUrl": "./",
    "optimize": "uglify2",
    "generateSourceMaps": true,
    "findNestedDependencies": true,
    "enforceDefine": true,
    "paths": {
        "select2": "lib/select2/3.4.5/select2",
        "socialvibe": "empty:",
        "greensock/easing/EasePack": "lib/greensock/1.11.7/easing/EasePack",
        "moment": "lib/moment/2.5.1/moment",
        "angular-ui-router": "lib/angular-ui-router/0.2.0/angular-ui-router",
        "states": "app-canvas/states",
        "angular": "lib/angular/1.2.13/angular",
        "greensock/plugins/CSSPlugin": "lib/greensock/1.11.7/plugins/CSSPlugin",
        "greensock/TimelineLite": "lib/greensock/1.11.7/TimelineLite",
        "debug": "lib/debug/0.1/debug",
        "WufooForm": "empty:",
        "sponsorPay": "empty:",
        "easyXDM": "empty:",
        "eventie/eventie": "lib/eventie/1.0.3/eventie",
        "jquery": "empty:",
        "angular-ui-bootstrap": "lib/angular-ui-bootstrap/0.10.0/angular-ui-bootstrap",
        "supersonicUltra": "empty:",
        "angular-cookies": "lib/angular/1.2.13/angular-cookies",
        "greensock/TimelineMax": "lib/greensock/1.11.7/TimelineMax",
        "ui/jquery.path": "ui/jquery.path",
        "underscore": "lib/underscore/1.5.2/underscore",
        "angular-ui-bootstrap-tpls": "lib/angular-ui-bootstrap/0.10.0/angular-ui-bootstrap-tpls",
        "angular-file-upload": "lib/angular-file-upload/1.1.4/angular-file-upload",
        "jqueryform": "lib/jqueryform/3.37.0-2013.07.11/jqueryform",
        "angular-ui-select2": "lib/angular-ui-select2/0.0.5/angular-ui-select2",
        "angular-animate": "lib/angular/1.2.13/angular-animate",
        "app": "app-canvas",
        "angular-local-storage": "lib/angular-local-storage/2014-01-10/angular-local-storage",
        "detect": "lib/detect/2.2.1/detect",
        "FB": "empty:",
        "angular-sortable": "lib/angular-sortable/1.0.0/angular-sortable",
        "imagesLoaded": "lib/imagesLoaded/3.0.4/imagesloaded",
        "ui/jquery.transform": "ui/jquery.transform",
        "eventEmitter/EventEmitter": "lib/eventEmitter/4.2.3/EventEmitter",
        "UnityObject2": "empty:", "ui/jquery.offsetHelpers": "ui/jquery.offsetHelpers",
        "trialpay": "empty:",
        "jscolor": "lib/jscolor/1.4.1/jscolor",
        "greensock/TweenMax": "lib/greensock/1.11.7/TweenMax",
        "greensock/TweenLite": "lib/greensock/1.11.7/TweenLite",
        "angular-route": "lib/angular/1.2.13/angular-route",
        "swfobject": "lib/swfobject/2.2/swfobject",
        "modernizr": "lib/modernizr/2.7.1/modernizr",
        "require": "lib/require/2.1.10/require", // ignore the version here, it's just what's used in the actual web app
        "jqueryui": "empty:",
        "twitter-bootstrap": "lib/twitter-bootstrap/3.1.0/bootstrap"
    },
    "mainConfigFile": "./js/redesign/main.js",
    "dir": "../WebContent/js/redesign-canvas",
    "modules": [
        {"name": "main"}
    ],
    "appDir": "./js/redesign/",
    "preserveLicenseComments": false
})

With 2.1.11, everything works fine, and all of the dependencies get concatenated into main.js. When I use 2.1.13 (no other changes!), no other files get concatenated with main.js. Here's the output from that part of the log:

     main.js
     ----------------
     main.js

Of course, with 2.1.11 there's a long list of other files. I didn't see anything obvious (to me, at least) in the list of issues included in .12 and .13 - is there anything that changed that would prevent this config from working, or is this another regression?

Please let me know if there's any other diagnostic info I can add to help.

@jrburke
Member
jrburke commented May 28, 2014

If you have a zip of the project I can try, that is probably the quickest way to find the cause. You can pass it privately to me at jrburke at gmail.com if that is easier. Otherwise, it would be good to know the contents of the main.js file, maybe the structure of it means r.js is not finding the dependencies now.

@jrburke jrburke added this to the 2.1.14 milestone Jun 1, 2014
@jrburke jrburke added a commit to requirejs/r.js that closed this issue Jun 1, 2014
@jrburke jrburke Fixes requirejs/requirejs#1133, UMD wrapper detection was too aggressive
Instead, pass scope of function expression identifiers, and only skip parsing if define uses one of those identifiers.
90ff54a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment