- Added the
config
option #60- This allows you to pass module information, that you set in your configuration, to your modules. Reference: http://requirejs.org/docs/api.html#config-moduleconfig
Examples
onModuleBundleComplete: function (data) {
var fs = module.require('fs'),
amdclean = module.require('amdclean'),
outputFile = data.path,
cleanedCode = amdclean.clean({
'filePath': outputFile,
'config': {
'test': {
'size': 'large'
}
}
});
fs.writeFileSync(outputFile, cleanedCode);
}
//test.js, which uses simplified CJS wrapping:
//http://requirejs.org/docs/whyamd.html#sugar
define(function (require, exports, module) {
//Will be the value 'large'
var size = module.config().size;
});
//test.js which uses a dependency array,
//it asks for the special module ID, 'module':
//https://github.com/jrburke/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#wiki-magic
define(['module'], function (module) {
//Will be the value 'large'
var size = module.config().size;
});
- Updated the
prefixTransform
option to pass BOTH post normalized and pre normalized module names #59
'prefixTransform': function(postNormalizedModuleName, preNormalizedModuleName) {
return postNormalizedModuleName;
}
- Fixed a regression bug that did not correctly catch all conditional AMD statements #61