brunch / deppack

Extract node modules to browser.
MIT License
4 stars 13 forks source link

Issue explicit error on shim failure #10

Closed garthk closed 8 years ago

garthk commented 8 years ago

If shimming child_process, dns, fs, net etc:

The root cause is shimming the un-shimmable. Troubleshooting would be easier if shimAliases' reducer did something like:

const shim = shims.fileShims[x];
assert.notEqual(shim, undefined, `no shim available for ${x}`);
const mod = generateFileBasedModuleName(shim);

I can submit a PR for that if someone can confirm my theory about what's going on, here. I haven't yet given Brunch explicit instructions on how to behave. It strikes me it's inhaling my server-side modules as if they're client side.

goshacmd commented 8 years ago

Thanks for the report! The way to fix is to simply skip these shims as no alias is needed for these, because brunch will shim them to {} anyway.

I submitted https://github.com/brunch/deppack/pull/11 to address this.