anodynos / uRequire

The Ultimate JavaScript Module Builder & Automagical Task Runner. Convert AMD & CommonJS/NodeJS modules to UMD, AMD, CommonJS or bundle them as `combined.js` (rjs & almond, AMDclean soon) & automagically run/test/watch them on nodejs, Web/AMD or Web/Script. Declarative & DRY config with inheritance. Manipulate & inject dependencies, module code, banners, version etc while building with a single line. Support two kinds of plugins, ResourceConverter (i.e file level) and AfterBuilder (i.e the whole bundle). Transparent support for Coffeescript, IcedCoffeescript, Coco, LiveScript – they’re just JavaScript :-)
http://anodynos.github.io/uRequire
MIT License
265 stars 20 forks source link

Prevent Code Convertion #68

Closed syaiful6 closed 8 years ago

syaiful6 commented 9 years ago

Thanks for the great project, by the way how i prevent uRequire convert the source code? It's look like do some convertion like:

var dest = (function() {
    return [];
})();

to something:

var dest = function() {
    return [];
}();

I use uRequire with grunt, is there any option for this?

anodynos commented 8 years ago

Thanks for your kind words - perhaps you can pass some options to esprima codegen, I am not sure this option is supported by esprima though. I will look into it and let you know!

syaiful6 commented 8 years ago

hi @anodynos, dont worry, well i know the generated code is valid. it's just minor issue.

I think uRequire doesn't have to any code convertion like this, so i open this issue.

anodynos commented 8 years ago

Thanks @syaiful6 - you can set a codegenOptions object on a Module (via a ResourceConverter) to force a specific code generated format. I had a look at escodegen API though and can't find any relevant option... So I'll close this issue :-)