Open matthewmueller opened 9 years ago
With the change @stephenmathieson has made in duojs/package#37, I think we should just add a proper npm provider. The above sounds brittle, especially if you use multiple npm packages.
Would this address building nested dependencies? The browserify CDN automatically builds all the dependencies and bundles them.
Wouldn't each npm package included have it's entire dependency tree bundled? Imagine I include 2 npm modules that have overlapping dependencies, wouldn't it duplicate a lot since each package would be bundled independently?
Not necessarily. iirc NPM prunes the dependencies and will move them up a level if two dependencies require the same dependency. Not sure if we could catch it before it does this though. On Tue, Apr 7, 2015 at 22:00 Dominic Barnes notifications@github.com wrote:
Wouldn't each npm package included have it's entire dependency tree bundled? Imagine I include 2 npm modules that have overlapping dependencies, wouldn't it duplicate a lot since each package would be bundled independently?
— Reply to this email directly or view it on GitHub https://github.com/duojs/duo/issues/456#issuecomment-90802016.
One simple (but not most efficient) way to support NPM packages would be to use the browserify CDN (with standalone), run derequire on it, then re-wrap in Duo.