Install package with NPM and add it to your development dependencies:
npm install --save-dev gulp-deamdify
|Description||Converts a module written in various files and AMD format in an autonomous one-file module.|
|Node Version||>= 1.0.0|
In example, let's say you have this library
// Main.js// file3.js// file2.js// file1.js
This plugin polyfills the code with a tiny AMD library and concatenates the results in order to get an one-file script that does exactly what your original code does. Note that this plugin won't order your files, you'll have to use another plugin such as gulp-amd-optimizer
Reason to be
It can be used with gulp-umd in order to take a library written under AMD format and compile it to UMD format, so it can be later used with RequireJs and CommonJs.
It is an alternative to Babel's deamdify, since it can be used with Typescript or CoffeeScript.
var deamdify = ;var optimizer = ;gulp;
Usage with Typescript
var deamdify = ;var ts = ;gulptask 'build' ->return gulp
Usage with gulp-umd
var deamdify = ;var ts = ;var umd = ;gulp;
Please feel free to fork or post and issue if you feel like.
Published under MIT License.