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

Root Exports, JSHint #31

Closed englercj closed 11 years ago

englercj commented 11 years ago

I am exporting my core API via a statement at the top of the file:

({urequire: { rootExports: 'gf' } });

Unfortunately, this causes a jshint error:

[L1:C36] W030: Expected an assignment or function call and instead saw an expression.
({urequire: { rootExports: 'gf' } });

Is there any other way to do root exports? Currently my grunt tasks fail because jshint fails on this line.

anodynos commented 11 years ago

Yes, you can use the bundle.dependencies.exports.root key in a urequire config.

So instead use

 bundle:dependencies:exports:root: {'moduleName': ['gf']}
englercj commented 11 years ago

Perfect, thanks!