Comparing version 2.0.0 to 2.1.0
32
index.js
@@ -0,5 +1,8 @@ | ||
'use strict'; | ||
var through = require('through'); | ||
var rfile = require('rfile'); | ||
var uglify = require('uglify-js'); | ||
var templateSTR = rfile('./template.js'); | ||
var uglify = require('uglify-js'); | ||
function template(moduleName, cjs) { | ||
@@ -28,17 +31,16 @@ var str = uglify.minify( | ||
return exports.prelude(name, cjs) + src + exports.postlude(name, cjs); | ||
} else { | ||
var strm = through(write, end); | ||
var first = true; | ||
function write(chunk) { | ||
if (first) strm.queue(exports.prelude(name, cjs)); | ||
first = false; | ||
strm.queue(chunk); | ||
} | ||
function end() { | ||
if (first) strm.queue(exports.prelude(name, cjs)); | ||
strm.queue(exports.postlude(name, cjs)); | ||
strm.queue(null); | ||
} | ||
return strm; | ||
} | ||
var strm = through(write, end); | ||
var first = true; | ||
function write(chunk) { | ||
if (first) strm.queue(exports.prelude(name, cjs)); | ||
first = false; | ||
strm.queue(chunk); | ||
} | ||
function end() { | ||
if (first) strm.queue(exports.prelude(name, cjs)); | ||
strm.queue(exports.postlude(name, cjs)); | ||
strm.queue(null); | ||
} | ||
return strm; | ||
}; | ||
@@ -45,0 +47,0 @@ |
{ | ||
"name": "umd", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Universal Module Definition for use in automated build systems", | ||
@@ -5,0 +5,0 @@ "bin": "./bin/cli.js", |
;(function (f) { | ||
// CommonJS | ||
if (typeof exports === "object") { | ||
if (typeof exports === "object" && typeof module !== "undefined") { | ||
module.exports = f(); | ||
@@ -8,3 +8,3 @@ | ||
} else if (typeof define === "function" && define.amd) { | ||
define(f); | ||
define([], f); | ||
@@ -11,0 +11,0 @@ // <script> |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var assert = require('assert') | ||
@@ -17,3 +19,4 @@ var umd = require('../') | ||
var defed | ||
function define(fn) { | ||
function define(d, fn) { | ||
assert.deepEqual(d, [], 'You must pass an empty array of dependencies to amd to prevent dependency scanning.'); | ||
defed = fn() | ||
@@ -20,0 +23,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10249
10
180