/** MIT License (c) copyright 2010-2013 B Cavalier & J Hann */

/**
 * cram CommonJS modules/1.1 plugin
 */
define(['./jsEncode', '../loader/cjsm11'], function (jsEncode, wrapCjsm11) {

	return {
		compile: function (pluginId, resId, req, io, config) {
			io.read(resId, function (text) {
				io.write(jsEncode(wrapCjsm11(text, resId)));
			}, io.error);
		}
	};

});

/** MIT License (c) copyright 2010-2013 B Cavalier & J Hann */

/**
 * cram CommonJS modules/1.1 plugin
 */
define(['./jsEncode', '../loader/cjsm11'], function (jsEncode, wrapCjsm11) {

	return {
		compile: function (pluginId, resId, req, io, config) {
			if (resId.substr(resId.length - 3) !== ".js") {
				resId += ".js";
			}
			io.read(resId, function (text) {
				io.write(jsEncode(wrapCjsm11(text, resId)));
			}, io.error);
		}
	};

});

Add .js to cjs module id if needed for cram
Add .js to cjs module id if needed for cram
