browserify-shim icon indicating copy to clipboard operation
browserify-shim copied to clipboard

Doesn't understand browserify external

Open dizel3d opened this issue 10 years ago • 6 comments

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.

dizel3d avatar Apr 08 '15 11:04 dizel3d

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

bendrucker avatar Apr 11 '15 17:04 bendrucker

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

dizel3d avatar Apr 30 '15 07:04 dizel3d

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.

dizel3d avatar May 03 '15 10:05 dizel3d

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).

jeron-diovis avatar Jun 26 '15 12:06 jeron-diovis

Nope, haven't had an opportunity to look

bendrucker avatar Jun 26 '15 14:06 bendrucker

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.

thlorenz avatar Jun 26 '15 16:06 thlorenz