gulp-wrap-umd icon indicating copy to clipboard operation
gulp-wrap-umd copied to clipboard

added new option: `globalExportTemplate`

Open bsara opened this issue 9 years ago • 3 comments

bsara avatar Jul 17 '15 23:07 bsara

what is the use case for this? It seems like a really complex feature for what I feel isn't gaining much benefit.

phated avatar Jul 19 '15 22:07 phated

Sometimes I want to initialize the namespace before adding whatever comes out of factory to that namespace. This happens when all I'm returning from factory is a function, rather than an object that contains the exported functions.

Also, I have a use case where I want all of the functions exported to be added to the namespace, but there is also an additional namespace exported that I do not want to be contained within the namespace that contains all of the functions exported.

I tried to make the modification general enough such that it wouldn't just solve my two use cases but also allow for other unforseen use cases in the future.

bsara avatar Jul 20 '15 16:07 bsara

basically, AMD and CommonJS exports are very straightforward and standard...where a "global" export might not always be so standard and, thus, some amount of control/customization may be needed by users of the plugin.

bsara avatar Jul 20 '15 16:07 bsara