amdclean
amdclean copied to clipboard
Sometimes wrong callback parameters when using module.exports
I have wrapped all my AMD modules in the simplified CommonJS wrapper. Sometimes I set properties on exports
, but if I only want to export one object, I'm assigning it to module.exports
. I found a case where amdclean generates invalid code, I've made an example: https://github.com/herrernst/amdclean-module_exports-testcase. It works when using requirejs dynamically and also optimized with r.js, but processing it with amdclean, it doesn't (second console.log
prints undefined
). In line 24, when setting the main
module, the callback function parameters are exports
and _config_
, but in line 32, the parameters passed for execution of the function are exports
and animal
, the latter being wrong (causing config
being assigned to animal
in the body of the function).
It would be great if you could look into that, thank you. I'm loving this project, by the way!
I've also found some problems with wrapped CJS modules. See #104