Skip to content

jaredhanson/component-amd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

component-amd

Component builder plugin that transpiles AMD modules into CommonJS modules which can be included in component builds.

With this plugin in use, CommonJS and AMD modules can be freely intermixed within the component toolchain.

Install

$ npm install component-amd

Usage

Command Line

Build the component, including AMD modules, by invoking component build with component-amd in use.

component build -u component-amd

API

var fs      = require('fs')
  , Builder = require('component-builder')
  , amd     = require('component-amd');

var builder = new Builder(__dirname);

builder.use(amd);

builder.build(function(err, obj) {
  if (err) throw err;
  fs.writeFileSync('build/build.js', obj.require + obj.js);
  if (obj.css) fs.writeFileSync('build/build.css', obj.css);
});

Tests

$ npm install
$ make test

Build Status David DM

Credits

License

The MIT License

Copyright (c) 2013 Jared Hanson <http://jaredhanson.net/>

About

Component builder plugin that transforms AMD to CommonJS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published