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

"backbone.XXXXXX" replaced with "backbone" in final output #55

Closed codeimpossible closed 10 years ago

codeimpossible commented 10 years ago

I'm using urequire on a project at work and am seeing references to "backbone.validation" being replaced with "backbone":

before

var Backbone = require('backbone');
var Validation = require('backbone.validation');
// ... snip ...

after

(function (window, global) {
  define(['require', 'exports', 'module', 'backbone', 'backbone'], function (require, exports, module) {
var Backbone = require("backbone");
var Validation = require("backbone");
// ... snip ...

Here is my urequire config:

  , urequire: {
    app: {
      template: 'AMD'
      , path: './src/main/webapp/compiled/app/'
      , filez: [
        /./
        , '!config.js'
        , '!main.js'
      ]
      , runtimeInfo: ['!**/*']
    }
    , _defaults: {
      forceOverwriteSources: true
    }
  }

Is there an option I can add to prevent urequire from overwriting my require statements?

anodynos commented 10 years ago

Surely the problem is the dot (.) in your 'backbone.validation' - why do you use the dot anyway ?

The npm package comes as npm install backbone-validation and the standalone file is backbone-validation.js.

Please try with - and let me know and thanks for pointing out that uRequire strips the last part after . as extension...

anodynos commented 10 years ago

closing as its not probably not an issue - let me know if you still have problems