Skip to content

$ being replaced? #2

Closed
Closed

Description

@colinsullivan

I am trying to use browserify as follows:

server.use(require('browserify')({
    base: __dirname + '/js', 
    mount: '/browserify.js', 
    require: ['underscore', 'backbone']
}));

backbone contains this line (among others):

// For Backbone's purposes, either jQuery or Zepto owns the `$` variable.
var $ = this.jQuery || this.Zepto;

Which browserify is turning into:

// For Backbone's purposes, either jQuery or Zepto owns the `_browserifyRequire.modules["./lib/vendor/backbone"] = function () {
  var module = { exports : {} };
  var exports = module.exports;
  var require = function (path) {
      return _browserifyRequire.fromFile("./lib/vendor/backbone", path);
  };

  (function () {
       variable.
var $ = this.jQuery || this.Zepto;

The dollar sign you are using in your regular expressions seems to be conflicting with jQuery somehow.

Activity

  1. added a commit that references this issue on Mar 6, 2020
    b005bc2
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