BlueSpire/Weyland — pull request #12 by benpriebe (2013-10-29 07:06:10+00:00)
Title: Removed restriction on only .html and .js files being passed down to tasks. 

## The Problem:

The existing code navigated down through the entire nested folder structure starting at the folder where the weyland-config.js file was stored and only passed through files with extensions .html and .js only.

*If a user wanted to use the requireJS text plugin and require in a file with an extension other than .html or .js they couldn't do it in optimized mode. Any include/exclude wildcards they put in a task that weren't js or html were ignored.*

## A Solution:

I've updated the solution to allow users to pass in an options object to the build allowing them to provide include and exclude properties (exactly how the task configs work). This provides two benefits:

1. It fixes the problem where only .js and .html files are available for the optimized build.
2. The user can reduce the number of files parsed for a build by filtering the files that are passed down to tasks.

*before:*
```
weyland.build("main")
```

*after:*

backwards compatible

```
weyland.build("main")
```

OR:

```
weyland.build({
name: "main",
include: ['app/**/*.{js,html,htm,png,txt,xml}'],
exclude: ['**/test/*.js']
});
```

So a user can now do something like this to include requireJS text files with any extension they like:

```
exports.config = function(weyland) {
weyland.build(
{
name: "main",
include: ['**/*.{js,html,htm,png,txt,xml}'],
})
.task.rjs({
include: ['app/**/*.{js,html,htm,png,txt,xml}', '../libraries/durandal/js/**/*.js'],
loaderPluginExtensionMaps:{
'.html': 'text',
'.htm': 'text',
'.png': 'text',
'.xml': 'text',
'.txt': 'text',
},
rjs: { ... }
});
}