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

Revamp `path` and 'dstPath' to `src` & `dst` Objects/Arrays ;}) #40

Open anodynos opened 10 years ago

anodynos commented 10 years ago

Instead of having bundle.path and its corresponding bundle.filez, we should have src: an array of objects with {path, filez} or shortcut [path, filez], like

  src: [
    [ '../../other/path/libA', ["this/path/from/libA/**/*" ] ]
    [ 'node_modules/dist/libB', [/./,  (f)-> f isnt 'badfile')] ]

    # or the boring
    {
      path: "some/path"
      filez: ['some/filespecs/*.*']
    }
   ..
  ]

that all together define a virtual files source.

Notes:

  ['bower_components/lodash/dist/', 'lodash.js']
  # or better
  [ 'lodash' ] # that resolves to the above, that effectivelly is inlining lodash in bundle (UMD, or combined) as a 'normal' module of bundle's root.
Tvaroh commented 10 years ago

+1