jrburke/requirejs — Issue #131: Optimizer attempts to find excluded modules
Author: bruth
Created: 2011-10-19 13:33:48+00:00
State: open

`main.js` file:

```javascript
define(['foo/main']), function() {});
```

`app.build.js` file:

```javascript
...
modules: [{
name: 'main',
exclude: ['foo/main']
})
...
```

My `foo/main` is from a separate library (e.g. not in any local directory) but is a dependency of my `main` module.

I get an `Error evaluating module "undefined" at location ... Bad file descriptor` even though I am excluding it from the build. The hack I am using write now is to simply add `foo` to the `paths` hash, so it doesn't fail:

```javascript
paths: {
'foo': '.'
}
```

Everything works as expected once I do this, but it seems that all paths are attempting to be found prior to taking in account the excluded ones.