esamattis / browserify-externalize

Create external Browserify bundles for lazy asynchronous loading
https://npmjs.org/package/externalize
MIT License
73 stars 3 forks source link

Broken on latest browserify #5

Open Makio64 opened 9 years ago

Makio64 commented 9 years ago

Hello epeli,

externalize looks broken with the latest browserify. I get this error error when I try the example code :

TypeError: Cannot call method 'bind' of undefined at BundleManager.resolveModules (/path/node_modules/externalize/index.js:37:44)

I check and the bundle object don't have _resolve property anymore, any clue to fix it?

Thanks

esamattis commented 9 years ago

This module is not maintained anymore. Please try substack/factor-bundle instead.

Makio64 commented 9 years ago

Thanks for your answer!

Yeah I tried it but it didn't allow async loading.

So I tried partition-bundle but didn't success to acheive what I want with the common part + async loading + an easy way to config all that..

At the end I switched to webpack witch provide all that features from the box, very happy with it :)

Here how it works : https://github.com/Makio64/Template-Modules

Cheers!

adam-lynch commented 8 years ago

@epeli this is a shame, it's such a handy module. How hard would it be to fix? I've got it working by replacing _resolve with _bresolve and manually calling my callback after two seconds. So it's working except it's not calling the callback, I wonder why that is.

adam-lynch commented 8 years ago

To be clear, it's working with a simple module.exports = 'something' child module.

esamattis commented 8 years ago

No idea. I haven't followed how Browserify internals has evolved. This was written for 2.0 and the latest Browserify release is 12. That's quite a few major releases...

adam-lynch commented 8 years ago

@epeli good point. I think I'll give up :smile:. I think I might just create a new bundle without externalize, being careful about duplicate dependencies, and loading them on demand kinda like what you're doing except instead of requiring it, each module would have to add itself into a global which is already there. Down the line I might use factor-bundle or something.