Closed
Description
Hello,
I'm moving over my libraries to use webpack for a universal loader for the browser and Node.js. It's really great!
I have been scouring to find our how to make a dependency optional in webpack. Two cases:
- jquery - it is optional on the server
- stream (well, readable stream) - it is so large so I want it to be optional on the browser
If I require either, they get pulled into my build or if I use externals, they are added to the factory call like:
exports["kb"] = factory(require("underscore"), require("backbone"), require("moment"), require("stream"));
Is there a way to require these libraries in my library, but not make them a hard dependency?
Metadata
Metadata
Assignees
Labels
No labels