GitXplorerGitXplorer
t

umd-templates

public
4 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
091908d121815344b25170289d127e8201f03c62

Update package.json

ttalyssonoc committed 10 years ago
Unverified
e952f7d8042e431019d727c656049d5a737b274a

Improved loading

ttalyssonoc committed 10 years ago
Unverified
dea788e53059ab33a5362aff3be4302592a7d482

First commit

ttalyssonoc committed 10 years ago

README

The README file for this repository.

UMD Templates

These are UMD patterns for using with gulp-umd compliants.

Patterns:

  • amdWeb
  • amdWebGlobal
  • commonjsAdapter
  • commonjsStrict
  • commonjsStrictGlobal
  • jqueryPlugin
  • jqueryPluginCommonjs
  • nodeAdapter
  • returnExports
  • returnExportsGlobal

Usage

	var gulp = require('gulp');
	var umd = require('gulp-umd');
	var patterns = require('umd-templates');

	gulp.task('build', ['clean'], function() {  
	  return gulp.src([
	                    'src/foo.js'
	                ])
	    .pipe(umd({
	        exports: function(file) {
	            return 'Foo';
	        },

	        namespace: function(file) {
	            return 'Bar.Foo';
	        },

	        dependencies: function() {
	            return [
	                {
	                    name: 'dep1',
	                    amd: 'dep1',
	                    cjs: 'dep1',
	                    global: 'Dependence1',
	                    param: 'dep1'
	                },
	                {
	                    name: 'dep2',
	                    amd: 'dep2',
	                    cjs: 'dep2',
	                    global: '$',
	                    param: '$'
	                }
	            ]
	        },
	        template: patterns.returnExportsGlobal.path
	    }))
	    .pipe(gulp.dest('dist'));
	});

Todo

  • Write tests

Pull requests are welcome =)