Skip to content

jquery/builder-amd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Why builder-amd?

Use builder-amd to generate the JS bundle of an AMD modular project.

It's ideal for applications that builds bundles on the fly using Node.js.

Usage

npm install builder-amd

var fs = require( "js" );
var amdBuilder = require( "builder-amd" );

var files = {
  "main.js": fs.readFileSync( "./main.js" ),
  "foo.js": fs.readFileSync( "./foo.js" ),
  "bar.js": fs.readFileSync( "./foo.js" )
  ...
}

amdBuilder( files, {
  include: "main"
}, function( error, builtJs ) {
  ...
});

API

  • amdBuilder( files, requirejsConfig, callback )

files Object containing (path, data) key-value pairs, e.g.:

{
   <path-of-file-1>: <data-of-file-1>,
   <path-of-file-2>: <data-of-file-2>,
   ...
}

requirejsConfig Object require.js build configuration.

callback Function called with three arguments: null or an Error object, a String with the built css content, an Object with the cloned built files structure.

Test

npm test

License

MIT © OpenJS Foundation and other contributors

About

Generate the JS bundle of an AMD modular project on the fly on Node.js

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published