thlorenz / browserify-shim

📩 Makes CommonJS incompatible files browserifyable.
MIT License
933 stars 87 forks source link

Doesn't understand browserify external #155

Open dizel3d opened 9 years ago

dizel3d commented 9 years ago

I have 4 shimed libraries:

"browserify-shim": {
  "a": {
    "exports": "a"
  },
  "b": {
    "exports": "b"
  },
  "c": {
    "depends": ["a", "b"],
    "exports": "c"
  },
  "d": {
    "depends": ["a", "b"],
    "exports": "d"
  }
}

I want to group them in bundles: ab, cd. I specified external ["a", "b"] for bundle cd, but it still includes a and b content.

bendrucker commented 9 years ago

A repo concisely reproducing this would be a huge help. Otherwise, I'll try to make time for this in the next couple weeks.

dizel3d commented 9 years ago

Ok, I am going to make an example this weekend.

dizel3d commented 9 years ago

I have simplified an example and made test case https://github.com/dizel3d/browserify-shim-test-cases Test-case "with browserify-shim" in browserify-1-spec.js failed: the problem is that browserify-shim includes external module a.js in bundle b.

jeron-diovis commented 9 years ago

Any updates here? Have same problem in project.

Problem is actually here: having browser alias in package.json, we don't care about anything else (like external option).

bendrucker commented 9 years ago

Nope, haven't had an opportunity to look

thlorenz commented 9 years ago

If you don't provide a browserify alias for a and b, b-shim won't know what they are. At this point just browserify externals are not supported so you need to alias them as explained here.

Anything not outlined in that readme is not currently supported.