Open normanrz opened 10 years ago
options.include doesn't work now?
No, options.include
is not supported yet. I'll happily accept PRs on that :-)
It is not necessarily.
You can write in docs temporary descision:
.pipe(amdOptimize('main', {})) .pipe(require('gulp-add-src')('other_amd_file.js'));
Yeah, you're right. Turns out there is already a recipe in the readme for that using the event-stream
module: https://github.com/scalableminds/amd-optimize#recommended-modules
it's A solution but not THE solution :) I've used it for a bunch of simple modules containing viewmodels but I can't include the matching templates files... they can't go through amdoptimize and the require plugins (!text for now...) this way.
:+1: for include
. It's a really great tool when you want to include dynamic dependencies inside a bundle.
I would suggest a PR but I'm not at ease with coffeescript. I don't think this should be a very difficult feature, as it's just a matter of looping over the include
and applying the same logic as you apply to the main module.
Currently I work around this by using merge-stream
and gulp-unique-files
. I loop over my include array and call amd-optimize for each entry, then I merge all the resulting streams and remove dups with gulp-unique-files. Could be a recipe in the readme until include
is supported.
Another work-around I found is to build a fake file dynamically that requires everything you want to include and amd-optimize this.
Append/prepend other files or modules to bundle
Log Time