builder-amd
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -5,3 +5,3 @@ var requirejs = require( "requirejs-memfiles" ), | ||
function buildJs( files, config, callback ) { | ||
var include; | ||
var exclude, include; | ||
@@ -15,3 +15,5 @@ if ( typeof config !== "object" ) { | ||
exclude = config.exclude; | ||
include = config.include; | ||
delete config.exclude; | ||
delete config.include; | ||
@@ -31,2 +33,6 @@ | ||
if ( exclude ) { | ||
config.modules[ 0 ].exclude = exclude; | ||
} | ||
requirejs.setFiles( files, function( done ) { | ||
@@ -33,0 +39,0 @@ requirejs.optimize( config, function() { |
{ | ||
"name": "builder-amd", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -121,1 +121,25 @@ var files, | ||
describe( "onBuildWrite property", function() { | ||
var js; | ||
before(function( done ) { | ||
amdBuilder( files, { | ||
include: [ "foo" ], | ||
optimize: "none", | ||
onBuildWrite: function( id, path, contents ) { | ||
return "/* banner for " + id + " */\n" + contents; | ||
} | ||
}, function( error, result ) { | ||
if ( error ) { | ||
return done( error ); | ||
} | ||
js = result; | ||
done(); | ||
}); | ||
}); | ||
it( "should work just fine", function() { | ||
expect( js ).to.equal( "/* banner for bar */\ndefine('bar',[],function() {});\n\n/* banner for foo */\ndefine([ \"./bar\" ]);\n\n\ndefine(\"output\", function(){});\n" ); | ||
}); | ||
}); | ||
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
169
10599
11