Adds dubious fix for a possible error with loadTransform#60
Adds dubious fix for a possible error with loadTransform#60zachrose wants to merge 1 commit intobrowserify:masterfrom
Conversation
|
Hey @zachrose, is this something you're still interested in? Just asking to see if I should spend time on it or not since it's been 5 months 😞 |
|
Hey @zertosh, yeah I would be interested in having this looked at or merged. :) |
|
So here's how it works: Remember that node's There is a way to avoid this whole process. Just pass in a transform function 😄 Have you tried this: browserify({ /* yadda-yadda */}).transform( require('strictify') );I'm pretty sure that'll work. Let me know. I'd rather try to solve your problem given what's already available than add more complexity to the api. |
|
Ah, lol. Thanks for the exposition. I'll try that tomorrow. |
Hello @substack et al,
I have a issue that I don't totally understand and a fix that I don't totally understand either 😛. Perhaps by explaining the issue and showing the fix here someone can tell me what I've done wrong (or maybe what I've done right).
Here's the issue: I have an express app (let's call it B), that uses Browserify and the strictify plugin in a gulp task to bundle front-end JavaScript. Usually this works just fine. Then, for reasons I'd rather not get into, it made sense for B to be exported as a module into another express app (let's call it A), and used as middleware. (To make it's assets available, B has a postinstall script to run gulp.)
B has dependencies that are mostly non-overlapping with A's dependencies, except for underscore. As a result, running
npm installon A puts underscore in A/node_modules and not in A/node_modules/B/node_modules.In this arrangement, running the B's gulp task results in this error:
After some trial and error, I discovered this change to module_deps, in addition to that adding
{basedir: __dirname}as an option to my transform, like so:...prevents the error and seems to make everything work ok. (This change doesn't fail the tests, but of course that doesn't mean it's the correct thing to do.)
So here are my questions:
Thanks!