Skip to content

Optimizer: namespacing captures inner require #1438

Closed

Description

AFAICT, namespace attribute should only rename define and require in the root level, but not in this case:

define(["require"], function (require) {
  //...
  require(["module/id"], ...);
  // ...
});

But it does capture this require as well. In majority of cases it does not create harm, but there are cases which rely on require being the local require, not the root namespace.require (workaround - use different variable name).

Activity

  1. jrburke commented on Nov 16, 2015

    @jrburke
    Member

    Definitely a weakness in the namespace support. Since the work will happen in r.js, and is likely not a 2.x issue, filed requirejs/r.js#871, which would fix this bug, will be hard to do before that change. So closing this one in favor of tracking it in the other bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions