Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

builder-amd

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

builder-amd - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

8

index.js

@@ -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() {

2

package.json
{
"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" );
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc