-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make a packer for browserify #2
Comments
I'm not sure that's possible. You see, browserify is complex solution that allows you to use bundled modules outside the built file with And here comes the main difference (disadvantage and benefit in one) of pure-cjs - it gives you only the minimal required subset of CommonJS Modules w/o providing Node.js-like environment and thus with no need to preserve any paths at all outside the built file - but only using IDs for internal cross-module communication (which can be optimized even more in future). That's why it's called Pure CommonJS builder after all :P |
Well, looking at browserify bundles now, it seems without explicit configuration there's no globally unique string paths for modules but only local ones which can be replaced by integers. |
And so any dynamic resolution will be broken :) |
@RReverser hm... I don't really know what dynamic resolution is, can you point me to the section of browserify README which describes this feature? |
Dynamic resolution is how I name |
@RReverser ah, browserify doesn't support this as well, it just doesn't throw an error when encounters this. So if you do
browserify won't bundle |
Such code would work, you just need to explicitly put modules using |
@RReverser yeah, only if user called |
Not only those added with |
Ok, thanks for clarification of your position. Apparently there's already an optimizer for browserify bundles which does exactly that. According to browserify/browserify#296 it might be included in browserify. |
As you can see from optimizer commits, it's created 7 days ago (later than pure-cjs) so "already" is not exactly correct word ;) But yes, if it will be included, that would be great. |
Looking facebook/react#1002, wow, this is a really great improvement over browserify packer.
I'm wondering if it's possible using techniques pure-cjs employs to build a replacement for browser-pack (which is used by browserify) so everyone who use browserify in their build system would benefit with no change required to their code?
The text was updated successfully, but these errors were encountered: